Shared-mime checking order

Alexander Larsson alexl at
Tue Jul 31 22:20:28 PDT 2007

On Fri, 2007-07-27 at 20:11 +0200, Sanel Zukan wrote:
> Thank you for replies.
> > Yeah, I also found that too, when checking my chemical MIME types list.
> > Seems, priorities of "50" are enough for magic patterns. Should the spec
> > be adjusted? What do you (people in general) think about this? I mean,
> > the spec was written to have a standardized way to handle things. That
> > doesn't mean, that things cannot be improved :) So is it time to update
> > the spec? I would really like to see GNOME and KDE [1] (and other like
> > rox-filer, ...) detecting the file types with the same success (of
> > course, there are some false positives with the way of GNOME's
> > implementation too - so there is place for improvement :)).
> Yes; I'm also very interested to see unified detection, even if that
> detection for corner cases shows to be wrong.
> On other hand (maybe going little bit offtopic, but probably is perfect
> time to ask), you (Alexander) noted that GNOME is going to use more
> extension approach than mime magic checks. Why this way?

One other reason is performance. Magic detection is extremely seek heavy
and thus performs extremely bad. 

> Clearly, user can fix bad detected file by changing extension indeed, 
> but how often mime magic can be shown to be wrong? I.e. most of the (let say 
> binary) files are distinguished by unique header and returning bad mime 
> type (after magic check) is probably result that someone messed with that 
> file.

Given all the people swearing about the current gnome mime warning
dialog I'd say it get things wrong often enough to matter.

Often this is due to complicated contailer formats (like avi or mov)
rather than someone messing with the file.

 Alexander Larsson                                            Red Hat,
                   alexl at    alla at 
He's an uncontrollable overambitious inventor looking for a cure to the
coursing through his veins. She's a radical tempestuous safe cracker
beyond the grave. They fight crime! 

More information about the xdg mailing list