xdg-mime query filetype|default
Christian Neumair
cneumair at gnome.org
Tue Jun 26 04:25:56 PDT 2007
Am Dienstag, den 26.06.2007, 09:46 +0300 schrieb Stefan.Kost at nokia.com:
> hi,
>
> I have two issues I feel a bit lost about regarding the shared-mime
> handling.
> > xdg-mime query filetype song.ogg
> application/ogg
>
> but according to the matching rules
> in /usr/share/mime/packages/freedesktop.org.xml it should reply with
> audio/x-vorbis+ogg
> the rule is correct (I checked the file with hexdump -C) and the
> priority is higher than the generic application/ogg.
If you use xdg-mime under GNOME, it uses gnomevfs-info, which just
considers the passed-in filename and stat() unless you specify the "-s"
option. You can modify the "info_gnome()" function in the xdg-mime shell
script to pass "-s" to gnomevfs-info, and it will also consider the file
contents.
The current situation is a bit unfortunate, since we should really be
using the xdgmime MIME library instead of using third-party tools. Maybe
that is an option as soon as xdgmime will be distributed, and we have
something interface-stable to link against.
--
Christian Neumair <cneumair at gnome.org>
More information about the xdg
mailing list