MIME info spec: Handling containers/multiple MIME types per glob pattern

Alexander Larsson alexl at redhat.com
Fri Nov 18 00:45:51 PST 2005


On Tue, 2005-11-15 at 15:44 -0500, Rodney Dawes wrote:
> 
> I'm sure there are lots of cases where the same extension gets used for
> multiple file types. Is there any particular reason we should tell the
> application that it needs to rescan the MIME type by sniffing instead?
> Can we not just always sniff the first N bytes of the file, by doing
> what the "file" program does to sniff metadata? It seems like this would
> solve a lot of problems, and I doubt it would cause any significant
> performance issues.

On the contrary, sniffing files is an extreme performance problem, so
extreme that we disable it in gnome for files that match an extension
(although we do sniff when you e.g. open a file, to make sure we open it
with the right app). 

The problem with sniffing is that it opens each file in the directory
causing *massive* amounts of seeking, which is what is slow on modern
HDs. Reading consecutive data is fast, seeking is slow.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's an impetuous voodoo firefighter in a wheelchair. She's an orphaned 
cigar-chomping schoolgirl from a different time and place. They fight crime! 




More information about the xdg mailing list