Files with .h extention; inconsistent File Type

Please can anyone tell me why files with a .h extension appear in konqueror with a File Type of “C Header File” or “Plain Text Document” and not consistently only one of these.

Thank you - Mike

You are right in the assumption that .h files are header files:
http://en.wikipedia.org/wiki/Header_file

BUT

In Linux (unlike Windows) file extensions have no real meaning other than to point out the file type to humans, and sometimes for icon assignment … Linux will read the file contents and make up it’s own mind what type of fie it is … which is why if it’s a C header, Konqueror will display it as such, but if the header is in plain text format it will show that too.

Thank you for your clear and quick reply. They are all in fact include files so I guess it begs the question what criteria does it use to decide. As all the include files in question are supplied to me as part of a SDK it would be unwise and tedious to change them. The practical consequence is that double clicking on one opens in kwrite and vi improved on another. Can I change the default editor to always be the same? (At least its an improvement on a few months back when double clicking on a file when one was already open assumed I wanted to open Diff).

OK, file “types” are (AFAIK) indentified by Unix Magic Numbers … see here:
http://en.wikipedia.org/wiki/Magic_number_(programming)
and
http://en.wikipedia.org/wiki/List_of_file_signatures

Can I change the default editor to always be the same?

I would assume so, but it’s been ages since I used KDE … which Linux distro/version are you using ?

Is there no, right-click “Open With” option in Konqueror … where you can then choose to set the default application ?

Is there no, right-click "Open With" option in Konqueror .. where you can then choose to set the default application ?
I could confirm that (Chakra KDE 4.8 ) in Dolphin you can right-click the file and select Open with -> Other then select the desired application and put check by "Remember application association for this type of file"

Mark and SeZo - thank you both for your help - Mike

You’re more than welcome :slight_smile: