Giter Site home page Giter Site logo

Comments (11)

humdingerb avatar humdingerb commented on June 22, 2024

The "Tracker Kind shows" column above is rubbish, I've sinced removed it. I meant to say:

  • on ext2/3/4 the script is recognized by Tracker as a "Be application", under fat32/ntfs as "Generic file".
  • on ext2/3/4 the zip is recognized by Tracker as a "Generic file", under fat32/ntfs as "ZIP archive".

from filer.

owenca avatar owenca commented on June 22, 2024

Filer uses the MIME type of the file to determine if it's a shell command ("text/plain"), an archive ("application/zip"), or a generic file ("application/octet-stream"). What are the MIME types of your files when Haiku recognizes them as "Be application", etc.?

I have just noticed that:

  • .rsrc files are "application/octet-stream".

  • .o files have Kind "Be application" and an empty MIME type. (That's probably why script files from ext2/3/4 don't show up in file panels.)

I will change the code so that files with an empty MIME type get the same treatment as generic files. Now Filer really shows too many unknown/generic files in file panels.

Maybe a good compromise would be let the file panels for Archive and Command actions be restrictive and only show text or zip files. If the user wants to use the files with generic/unknown types, the drag&drop option is available.

from filer.

humdingerb avatar humdingerb commented on June 22, 2024

Filer uses the MIME type of the file to determine if it's a shell command ("text/plain"), an archive ("application/zip"), or a generic file ("application/octet-stream"). What are the MIME types of your files when Haiku recognizes them as "Be application", etc.?

As you correctly predicted, its file type is empty.

Maybe a good compromise would be let the file panels for Archive and Command actions be restrictive and only show text or zip files. If the user wants to use the files with generic/unknown types, the drag&drop option is available.

I don't think that's a good idea. Maybe the user isn't even aware of drag&drop and wonders why the file panel doesn't show his files while Tracker does.

.rsrc files are "application/octet-stream".
.o files have Kind "Be application" and an empty MIME type. (That's probably why script files from ext2/3/4 don't show up in file panels.)
I will change the code so that files with an empty MIME type get the same treatment as generic files. Now Filer really shows too many unknown/generic files in file panels.

Good. It's better to show too many files in the filtered file panels than too few. Also, most probably the scripts/archives the user sets as actions aren't in a location where there are .o or .rsrc files or even untyped generic files.
Alternatively, we could abandon filtered file pnels altogether, but I think it helps more to filter out the definitely unwanted files than showing sometimes a few untyped/generic files alongside.

from filer.

owenca avatar owenca commented on June 22, 2024

Does PR #116 fix this issue?

from filer.

humdingerb avatar humdingerb commented on June 22, 2024

Nope. I think it's a problem of what Haiku's file systems report. The behaviour described in those tables is still there, after #116 was merged.

from filer.

owenca avatar owenca commented on June 22, 2024

Hmm, I have to conclude that the MIME types of these files are neither empty nor generic ("application/octet-stream"). Can you try master...owenca:master to see what these mysterious MIME types are?

from filer.

humdingerb avatar humdingerb commented on June 22, 2024

Unfortunately, your code changes only print the MIME types when the file panel is opened the first time, which is always at /boot/home. Switching to a foreign-fs partition on my stick doesn't output anything.

from filer.

humdingerb avatar humdingerb commented on June 22, 2024

I hardcoded the path and did a SetPanelDirectory() when the filepanel is created. Here's the output:

Shell command

Filesystem Filepanel shows Terminal output
ext2/3/4 ZIP.zip SCRIPT.sh: application/x-vnd.Be-elfexecutable
fat32/ntfs SCRIPT.sh ZIP.zip: application/zip

Add to archive

Filesystem Filepanel shows Terminal output
ext2/3/4 ZIP.zip SCRIPT.sh: application/x-vnd.Be-elfexecutable
fat32/ntfs SCRIPT.sh + ZIP.zip nothing

from filer.

owenca avatar owenca commented on June 22, 2024

Unfortunately, your code changes only print the MIME types when the file panel is opened the first time

Weird. It works for me when I open the file panel for "Add to archive" or "Shell command", the only cases Filer looks for a particular MIME type. The extra code just prints the files that won't appear in file panel, including whenever the current folder changes in the panel.

Here's the output

From your tables, I can deduce the MIME types:

Filesystem SCRIPT.sh ZIP.zip
ext2/3/4 application/x-vnd.Be-elfexecutable application/octet-stream
fat32/ntfs application/octet-stream application/zip

So the elf executable is a "new" MIME type for Filer. I have added it to the MIME types of "Shell command". Can you try the updated commit?

from filer.

owenca avatar owenca commented on June 22, 2024

The first row of your first table will look like this now:

Shell command

Filesystem Filepanel shows Terminal output
ext2/3/4 SCRIPT.sh + ZIP.zip nothing

There will be no change in the second row, and the other table will stay the same.

from filer.

humdingerb avatar humdingerb commented on June 22, 2024

Yep. BTW, I was confused by the missing output for fat32 back then. It all works as expected, and I do see the output when trying with ext2, for example. I just wasn't prepared to "no output" and accidentally always tried with dropping the fat32 volume into the file panel and therefore assumed something was wrong... :)

from filer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.