File Format - Identifying File Type - Filename Extension

Filename Extension

One popular method used by many operating systems, including Windows, Mac OS X, CP/M, DOS, VMS, and VM/CMS, is to determine the format of a file based on the end of its name—the letters following the final period. This portion of the filename is known as the filename extension. For example, HTML documents are identified by names that end with .html (or .htm), and GIF images by .gif. In the original FAT filesystem, file names were limited to an eight-character identifier and a three-character extension, known as an 8.3 filename. Many formats still use three-character extensions even though modern operating systems and application programs no longer have this limitation. Since there is no standard list of extensions, more than one format can use the same extension, which can confuse both the operating system and users.

One artifact of this approach is that the system can easily be tricked into treating a file as a different format simply by renaming it—an HTML file can, for instance, be easily treated as plain text by renaming it from filename.html to filename.txt. Although this strategy was useful to expert users who could easily understand and manipulate this information, it was often confusing to less technical users, who could accidentally make a file unusable (or "lose" it) by renaming it incorrectly.

This led more recent operating system shells, such as Windows 95 and Mac OS X, to hide the extension when listing files. This prevents the user from accidentally changing the file type, and allows expert users to turn this feature off and display the extensions.

Hiding the extension, however, can create the appearance of two or more identical filenames in the same folder. For example, a company logo may be needed both in .eps format (for publishing) and .png format (for web sites). With the extensions visible, these would appear as the unique filenames "CompanyLogo.eps" and "CompanyLogo.png". On the other hand, hiding the extensions would make both appear as "CompanyLogo".

Hiding extensions can also pose a security risk. For example, malicious user can create an executable program with an innocent name such as "Holiday photo.jpg.exe". The ".exe" would be hidden and a user would see "Holiday photo.jpg", which would appear to be a JPEG image, unable to harm the machine save for bugs in the application used to view it. However, the operating system would still see the ".exe" extension and thus run the program, which would then be able to cause harm to the computer. To further trick users, it is possible to store an icon inside the program, in which case the operating system's icon assignment for the executable file (.exe) would be overridden with an icon commonly used to represent JPEG images, making the program look more like an image. This issue requires users with extensions hidden to be vigilant and never open files which seem to have an extension displayed despite the hidden option being enabled (since it must therefore have two extensions, the real one being unknown until hiding is disabled). This presents a practical problem for Windows systems where extension-hiding is turned on by default.

Read more about this topic:  File Format, Identifying File Type

Famous quotes containing the word extension:

    We are now a nation of people in daily contact with strangers. Thanks to mass transportation, school administrators and teachers often live many miles from the neighborhood schoolhouse. They are no longer in daily informal contact with parents, ministers, and other institution leaders . . . [and are] no longer a natural extension of parental authority.
    James P. Comer (20th century)