Right way to sniff mimetype from globs
Alexander Larsson
alexl at redhat.com
Tue Nov 13 00:58:40 PST 2007
On Sun, 2007-10-21 at 09:33 -0400, D Bera wrote:
> Hi,
> We use xdgmime in our application for mimetype detection. With the
> latest xdgmime and shared-mime-info, I observe the following (we use a
> detection order similar to gnomevfs-info, so thats what I am using for
> this example):
> $ echo "<html><head></head><body>hello</body></html>" > a.html
> $ gnomevfs-info [-s] a.html
> Name : a.html
> Type : Regular
> MIME type : application/x-mozilla-bookmarks
> ...
>
> which is clearly not right.
>
> This happens because both x-mozilla-bookmarks and text/html match the
> glob pattern *.html, x-mozilla-bookmarks is a subclass of text/html
> (and maybe also due to higher priority of x-mozilla-boormarks).
I think this change has been reverted.
However, the full solution involves adding a priority to the globs too.
This has been discussed, but not implemented.
More information about the xdg
mailing list