mimetype guessing is fooled by extension

Luciano Montanaro mikelima at cirulla.net
Wed Jul 21 15:25:37 BST 2004


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?

Luciano




More information about the kfm-devel mailing list