mimetype guessing is fooled by extension

Allan Sandfeld Jensen kde at carewolf.com
Sun Jul 25 12:14:56 BST 2004


On Wednesday 21 July 2004 16:25, Luciano Montanaro wrote:
> I created a very big file to test the file plugins (I noticed there were
> problems earlier this year), and I have found that, at least, the c++ and
> diff file plugin are tricked in a tight loop by it. I think this kind of
> plugins should bail out on files of unreasonable length, however, another
> issue is that the file was wrongly identified as a c++ file, while it does
> not even qualify as a text file (I don't think '\0' a valid character in a
> text file).
>
> "file prova.cpp" correctly says the file is a "data" file.
> Can't the mime identification be made smarter, using the file extension as
> an additinal hint instead of the only way to identify the file?
>
Yes, by setting X-KDE-PatternAccuracy to <100.
Notice that if you open the properties for the file, it will detect the 
content-mimetype more accurately.

I will make take a look at the issue.

`Allan




More information about the kfm-devel mailing list