Re: Suggestion for file type detection approach

On Do, 2003-12-25 at 14:48 -0300, Fabio Gomes wrote:
> I've spent some time today thinking about the costs and benefits of the
> two approaches used today in GNOME to determine the MIME Type of a file.
Thanks! We need such constructive input.

> Also, I've done some experiments and tweakings to check the impact that 
> file sniffing has over nautilus performance. It's impressive. See below.
> Currently, these two approaches are combined in the directory listing of
> Nautilus in a bit unclear manner. There seems to be some priority
> mechanism to decide wether the type of a file will be decided by content
> or suffix. However, the content is always read and tested.
> Additionaly, there are some proposals of implementing some kind of
> fallback, to test the contents of the file only when not able to
> determine by suffix.
> IMO, we could think a bit more and combine these two approaches in a way
> very different from simply doing the two things when reading the
> directory. 
> with sniffing    : 21 seconds
> without sniffing : less than one second
> I had similar difference with many folders of my machine, including
> /lib, /usr/lib, etc.

OK, here my proposal:
We could do two runs. In the first run, we simply don't sniff at all and
show the files ("Unknown Type"). While it is shown, we could start a
second run that checks for the MIME type (either by content or by
extension, is it worth a GConf pref?) and determine the actual file


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