[prev in list] [next in list] [prev in thread] [next in thread]
List: gnome-devel-list
Subject: Re: new mime detection approach
From: "Manuel Amador (Rudd-O)" <amadorm () usm ! edu ! ec>
Date: 2004-01-29 20:45:34
Message-ID: 1075409133.12508.30.camel () veronica ! amauta
[Download RAW message or body]
El mar, 20-01-2004 a las 12:21, Brian Nitz escribió:
> Alexander,
>
> I haven't looked at this gnome-vfs code in a while, but I suspect
> that you have to use regex and filename hints along with sniffing to
> differentiate some OpenOffice/Staroffice documents from zip files.
>
> Also I'm not sure it is possible to determine whether a .jar file is a
> Java library, data, or an executable without unpacking and looking in
> META-INF/MANIFEST.MF
>
> Do you have any suggestions on handling these cases?
>
> We will probably always need a mixture of sniffing and filetype/regex
> for legacy documents but wouldn't it be possible to write meta-data into
> a cache for all gnome documents written via gnome-vfs?
>
> A directory would contain a .vfs-meta file with something like this:
> Number of files: 3
> Number of files type-checked by gnome-vfs: 3
> myfile.jpg type:image/jpeg launchwith:gimp
> myfile.mov type:video/mpeg4 launchwith:totem
> myfile.xxx type:unknown launchwith:undefined
>
> If the .vfs-meta file doesn't exist or the number of files in a
> directory doesn't match the number typechecked by gnome-vfs, you'd know
> you have to do some sniffing. Wouldn't this speed up thumbnailing,
> launching and directory browing for all gnome created files?
Yes. This is also called EAs (when not done with standalone, hidden
files).
>
> If only this had been done right back in 1980 :(
It was done right. The apple mac did it right. We're pretty much the
only ones still on this. Even Windows will get away from this thing
once they release WinFS.
>
> -------------
> application/winvirus
> regex,2: \.doc\.scr
> regex,2: \.jpg\.exe...
>
>
> Alexander Larsson wrote:
> > On Thu, 2004-01-15 at 05:43, Peter Harvey wrote:
> >
> >
> >>I have no idea how the magic mime-type detection code works, but would
> >>it be made faster by using the extensions of a file as a hint? ie. if
> >>you are trying to determine the type of a file with .jpg extension,
> >>first check the JPEG magic entry? This should only involve reading the
> >>first few characters of the file.
> >
> >
> > This doesn't help. The slow part about sniffing is reading the first few
> > bytes of the file. You have to do several seeks on the hard-drive, and
> > each seek is delayed by the HD seek time and on average half a
> > rotational delay. This adds up to about 10-15 msecs per file, and faster
> > harddrives don't really make this better. In fact, Alan Cox claimed that
> > opening a new file takes about the same time as reading another 8 meg
> > from a continuous file (on modern disks).
> >
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > Alexander Larsson Red Hat, Inc
> > alexl@redhat.com alla@lysator.liu.se
> > He's an oversexed crooked stage actor whom everyone believes is mad. She's a
> > hard-bitten antique-collecting archaeologist with her own daytime radio talk
> > show. They fight crime!
> >
> > _______________________________________________
> > gnome-devel-list mailing list
> > gnome-devel-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/gnome-devel-list
--
Manuel Amador (Rudd-O)
GPG key ID: 0xC1033CAD at keyserver.net
["signature.asc" (application/pgp-signature)]
_______________________________________________
gnome-devel-list mailing list
gnome-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-devel-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic