Comment 5 for bug 510583

Revision history for this message
In , David Faure (faure) wrote :

gio and kio do it by following the shared-mime-info spec ;)
It says, under "Recommended checking order" :

If the glob matching fails or results in multiple conflicting mimetypes, read the contents of the file and do magic sniffing on it. If no magic rule matches the data (or if the content is not available), use the default type of application/octet-stream for binary data, or text/plain for textual data. If there was no glob match, use the magic match as the result.

If any of the mimetypes resulting from a glob match is equal to or a subclass of the result from the magic sniffing, use this as the result. This allows us for example to distinguish text files called "foo.doc" from MS-Word files with the same name, as the magic match for the MS-Word file would be application/x-ole-storage which the MS-Word type inherits.

http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-0.18.html