Filename Extension

Some operating systems use the last few characters of a file's name, its FilenameExtension, infer the file's type. For example, to MS-DOS and its cousins, a filename ending in ".exe" is an executable file; a filename ending in ".txt" is a text file, and so on.

Some systems don't use them; (older) Macintosh files use a 4-character file type code not stored in the FileName?. Unix uses a directory flag to indicate whether or not a file is executable. Unix filenames don't have extensions per se, but periods are legal elements of filenames and so file name suffixes can be used and understood by Unix programs. For example, a C compiler usually takes foo.c as input and produces foo.o as output. Most systems also support "MagicNumbers", in which the first two bytes of a file encode the file type. This is what makes the SheBang trick (as in #!/bin/perl) possible.

Others store more data. VmsOperatingSystem files have a version number after the extension: [directory]name.ext;123.


CategoryJargon, category FileTypingSystem


EditText of this page (last edited July 9, 2004) or FindPage with title or text search