GNOME Bugzilla – Bug 129792
extended attributes support for mime types
Last modified: 2013-02-05 03:22:13 UTC
hello. linux has a feature on many of its filesystems (ext2 and ext3, at least) called 'extended attributes'. this is how POSIX ACLs are implimented, but it's a rather generic interface. it allows, for example, setting of user-specified attributes of arbitrary names and types on a per-file basis. (attributes of the form user.___) the attr(5) man page, as an example, makes mention of using the user.mime_type attribute to specify the mime type of a file. i believe gnomevfs should support and honour this attribute. i've made a patch (which is little more than proof of concept). i know that it won't compile on machines that don't have xattr support (because i don't know how to use autoconf). is there any interest for this sort of feature? perhaps it would be better to impliment a more generic extended attribute interface in gnomevfs and then impliment the mime type lookup through that new interface. perhaps this is a bit heavy, though, and something better left to nautilus (ie: you can view/set attributes in the file properties dialog and gnomevfs only knows or cares about user.mime_type) just some ideas. it would be nice if this was supported in some way for the future, though (maybe even in 2.6!) thanks.
Created attachment 22618 [details] [review] my (bad) patch (against 2.5.3)
For the record, http://mail.gnome.org/archives/nautilus-list/2004-January/msg00003.html has another proof of concept patch about gnome-vfs and EAs.
There has been lots of discussion about mime types recently, and some changes has been made. I'm not sure doing mime types with EAs like this is the right thing. Its pretty slow for one, and the EA can become stale etc.
Adding the PATCH keyword.
I'm personally very interested in EA support for gnome-vfs. I think that EA is the only viable long-term solution for determining MIME types. Determining MIME types by file name extension is error-prone and ugly. (I for one don't use file extensions on all my files, for example.) Determining MIME types by file content is also error-prone and slow. Keeping the type with the file is the best solution IMO. If there is interest in a solution, I am willing to write a proper patch. Both patches supplied in this bug have their strengths, but are also missing stuff.
Sebastian: please see and comment on/modify http://live.gnome.org/GnomeVFSMetadata
There is an apache module, mod_mime_xattr (http://0pointer.de/lennart/projects/mod_mime_xattr/) that has settled on using user.mime_type as their MIME-type hinter. I think GNOME-VFS should honour this EA if it is present. Otherwise it can fall back to the old methods. That live.gnome.org page is dead. As is this bug, apparently. Can we drum up some more interest in this, please? Filename extensions suck.
How feasible is it to re-invent the wheel (a bit) and add more integrated support for file type into our file systems? How does this work on Mac OS X?
This would be very useful to me as a general user, and would go a long way towards letting me clean up my desktop even more. I run across MIME errors quite frequently, especially with MATLAB scripts being detected as Objective C source files and data files (.dat) being opened with Totem.
gnome-vfs has been deprecated and superseded by gio/gvfs since GNOME 2.22, hence mass-closing many of the gnome-vfs requests/bug reports. This means that gnome-vfs is NOT actively maintained anymore, however patches are still welcome. If your reported issue is still valid for gio/gvfs, please feel free to file a bug report against glib/gio or gvfs. @Bugzilla mail recipients: query for gnome-vfs-mass-close to get rid of this notification noise all together. General further information: http://en.wikipedia.org/wiki/GVFS Reasons behind this decision are listed at http://www.mail-archive.com/gnome-vfs-list@gnome.org/msg00899.html
Lets just close this for now.