Re: Suggestion for file type detection approach
- From: Adam Williams <awilliam whitemice org>
- To: Yves Dionne <dionney hotmail com>
- Cc: gnome-vfs-list gnome org, nautilus-list gnome org, gnome-list gnome org, gnome-devel-list gnome org
- Subject: Re: Suggestion for file type detection approach
- Date: Sun Jan 4 08:14:06 2004
> > > File extenstions are just DUMB and EASILY broken. Sniffing is expensive
> > > and unreliable.
> > Indeed, but it's all we have for now. Now = 2.6.
> I thought this could be fun, so hacked gnome-vfs to save the mime type
> on a EA named "mime_type".
> When trying to find the mime type for the file, gnome-vfs will first
> check if this EA exists. If so, use that for the mime type. If not,
> determine the mime type as usual and save it.
Yes, please! I mentioned EA awhile ago to no response; sniff, look at
extensions, whatever - and keep your results. Even better if
applications that created files put the EA tags in themselves. This is
so obviously the right solution - Mac OS has been doing this forever,
and Winblows is starting to make real use of EA as well. EA follow the
file when copied, moved, etc... You could even store a thumbnail in EA
and not generate one every time or cache it somewhere annoying like
".nautilus".
> It works only for local files.
Not sure this is true. The EA on NTFS can be accessed by CIFS calls,
and NFSv4 at least supports extended attributes. But maybe niether are
ture on Linux at this point.
> If you don't have permission to change
> the file, the EA will not be saved. And you need a file system which
> support EA, of course. I tested it with ext3. Might work with others
> too.
Works with ext3, XFS, and JFS (at least).
> This is a hack, just an exercise to see if it could be beneficial. I did
> this just for fun. I did not try to follow coding standards, I have no
> intention of maintaining this patch. Although I might try to hack
> nautilus to allow changing the mime type (as recorded in the EA).
> The following patch is against gnome-vfs-2.4.1 as found in Fedora. I
> attach also a modified SPEC file, just in case someone wants to build
> it.
Excellent.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]