Results 1 to 3 of 3
Hello Everyone,
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-08-2009 #1Just Joined!
- Join Date
- Jun 2009
- Posts
- 2
Custom File Extenstions
Hello Everyone,
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???
Thanks
~ mike
- 06-08-2009 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
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 shabangIf the filetype in question is to be interpreted maybe you can have a similar definition as the file header?Code:#!/bin/bash
- 06-08-2009 #3Just Joined!
- Join Date
- Jun 2009
- Posts
- 2


Reply With Quote

