Filename extension

From ArticleWorld

A filename extension is a set of characters appended at the end of a file, usually in order to make its type distinguishable from others. This practice originated from CP/M, and was later used under DOS and Microsoft Windows.


Microsoft Windows is the most popular user of the file extensions. Filename extensions are basically a type of metadata for this system and many of its managers.

The extension is typically three characters long, mostly due to historical limitations (the early filesystem could only use files with names up to 8 characters long a 3 characters extension, known as the 8.3 convention).


The use of extensions as the only way of knowing a file's content has attracted a great deal of criticism, especially since it is only exists due to historical limitations.

First of all, the problem is that it leads to many confusions. Since there is a great number of available programs, one extension often ends up associated with more types of files. For example, .rpm is used both for the RPM Package Manger packages and for RealPlayer Media files.

Some operating systems, like Unix, don't use extensions at all, and letters coming after a period (.) in a file name are treated like any other characters. This means that file names like (for example) press.release.text are perfectly valid and may be in any file format. If a user will try to save changes using an operating system that does not support long file names, the extension will be lost. The other problem may be that the file may contain HTML data, which would be easy to recognize using a magic-number technique. If the operating system doesn't implement this, it will not know how to open it.

Extensions have also been the source of many security risks.This happened due to the fact that many file managers choose to hide a file's extension from the user, to prevent the case where the extension is accidentally removed while renaming the file. The problem is that some extensions are quite popular, and quite about everyone knows about them. Therefore, a file called something.jpg.exe would have its extension (.exe) hidden. However, it may end up accidentally double-clicked in a file manager, since it looks a lot like an image. This is how many viruses spread.