ROX-Filer determines the "run action" by the MIME type.
So the question is: How does ROX-Filer determine the MIME type?
MMview uses the file command to retrieve the MIME type and displays it in the statusbar. ROX-Filer often disagrees.
While file looks into a file and determines MIME types primarily by magic numbers, ROX-Filer firstly tries to determine MIME by the file extension (as defined in /usr/share/mime/globs). Consequently ROX-Filer is easily fooled by a fake extension. Add a .jpg extension to any file and ROX-Filer "sees" an image file.
It would be not my job to correct ROX. If ROX produces nonsense MMview would have to faithfully reproduce the nonsense.
I thought that this would be easy with the -m option of the rox command:
Code: Select all
-m, --mime-type=FILE print MIME type of FILE and exit
1) The MIME type rox -m outputs may depend on the state of the executable file attribute. For files on a FAT file system, where the executable attribute is automatically set for all files, this may lead to funny results.
2) ROX-Filer's properties dialog may not agree with the output of rox -m. With ROX-Filer having its own method of MIME sniffing the prediction of the run action becomes difficult.
In order to sort out this mess I have listed MIME types produced by different commands and for different filenames and attributes. I marked results which I find plain wrong red, those acceptable yellow and the "good" ones green.
Based on this table I will have to come up with a formula for MMview.