mimetype guessing is fooled by extension

Stephan Kulow coolo at kde.org
Sun Jul 25 18:04:12 BST 2004


Am Sonntag 25 Juli 2004 14:28 schrieb Luciano Montanaro:

> > Oops. One major problem. The magic(content) detection code can correctly
> > detect diff, c++ and c-files. Diff will work fine by setting
> > X-KDE-PatternAccuracy as suggested above, but C and C++ is detected as
> > "text/x-c++" and "text/x-c" which does not exists as mimetypes in KDE
> > (has "text/x-csrc" and "text/x-chdr"). What is worse is that the
> > magic-code _cannot_ detect the difference between headers and source, so
> > we end up in situation where a combination of patterns and magic is
> > needed to do proper detection. There is currently no way to do that.
>
> Well, the only way to distinguish a C/C++ include file from a regular C/C++
> source is from its extension... C++ now encourages the use of
> extension-less includes, and Qt 4 seems to go in that direction.
Perhaps I'm just lacking the imagination, but what application relies on the 
difference between header and source?

Greetings, Stephan




More information about the kfm-devel mailing list