Re: new mime detection approach



On Tue, 2004-01-20 at 18:21, Brian Nitz wrote:
> 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.

Indeed, this is what the code does, had you looked.

> 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?

This has been discussed forever in this thread. What if you don't have
permission to write the file? What if the directory is public and people
want to launch files with different apps? (or someone sets
launchwith:"rm -rf ~".) What if two apps access it at the same time?
(And we've seen with GConf how badly file locking works in reality.) 
What if the data goes stale due to a file changing? People will dislike
the .vfs-meta files scattered all around. etc, etc, etc.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a Nobel prize-winning gay card sharp haunted by memories of 'Nam. She's a 
violent mute museum curator with only herself to blame. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]