Re: Suggestion for file type detection approach



Fabio Gomes <bugtraq gs2 com br> writes:

> Why not sniff file suffix (FORCE_FAST_MIME_TYPE) in the first run?
> Providing the user with a list of unknown files is useless. 
>
> Also, what to do if the type of a file as detected in the second run is
> different from the first? 
>
> - Forget about the new type? Forget abot the old one? 
> - Show some emblem? If so, which icon should be used? The old one or the
>   new?
> - What to do to open the file? Hmm.

I would completly strip the second run for files that can be detected
via the filename or filesuffix, having a second run that might
invalidates the first is really pretty damn evil, after all it would
results in situations where the file-icon would 'flip' its behaviour
from one to another, making incremental loading almost useless since
the user can't click on anything without fearing that the icon would
flip a second before the click. Incremental loading should really just
add information to an already visible icon, not change its position or
behaviour in unexpected ways, stuff like that makes incremental
loading pretty much useless, since clicking and changing and jumping
bunch of icons is not fun (its Konqueror, but pretty much shows the
problem with incremental loading):

http://pingus.seul.org/~grumbel/tmp/kdesucks/konqinmotion.png

Anyway, back to another issue with file-content detection, I have a
whole bunch of files that are pretty much plain ascii, however the
file-suffix marks these files for there usage, ie. as C file (.c), as
Vertex list for a 3D programm (.obj), as level file for a game, as
image file (.xpm) and such. Judging from the file-content alone will
never ever really give much useable results on these files, since the
content alone doesn't give any hint on how the files are ment to be
used, its just the file-suffix which allows these files to be handled
in a meaningfull way.

> If the stuff is going to be optional, I guess we will need a GUI such
> as:
>
> Determine file types by:
> 	( ) Content

I have yet to see a situation where detection on content really
performs better than on filename. I think detection by content is
really more something that one want to trigger an demand ('file'
like), than having the computer doing it automatically.

-- 
WWW:      http://pingus.seul.org/~grumbel/ 
JabberID: grumbel jabber org 
ICQ:      59461927



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