Custom File Extenstions
I'm working on an application in C/C++, and it requires files with a custom file extension. I was just curious about how to do this in Linux. In Windows I could just create the files and the application using the file would be setup to interpret it, figure out what to do, etc., and it would work. Is it the same in Linux???? If not, could you describe it for me???
Strictly speaking that's not how it works. Filetypes are determined by their contents rather than their extension. If you take a jpeg for example and remove its file extension, it'll still be recognised as a jpeg. You can use the file command to identify a filetype but I would imagine in your case of a custom file format this might not exist.
I think Gnome and KDE now have support for particular extensions rather than filetypes so you may be able to get by. Shell scripts on the other hand define their respective shell with a shabang
If the filetype in question is to be interpreted maybe you can have a similar definition as the file header?
Thanks. I think I'll be able to handle it fairly easily :D
Originally Posted by bigtomrodney