Filename extension

from Wikipedia, the free encyclopedia

The file name extension ( English file name extension ), as a file extension , file extension , file extension , or file suffix denotes the last part of a file name and is usually separated by a point (where the point itself is not considered part of the extension). The file extension is often used to make the format of a file recognizable so that it can be opened with a suitable application program , for example. It is partly applied in the same way to directories.

Example: indicates a simple text file . name.txt

Since file extensions are not standardized, it can happen that a file name extension is used for different file types.

You can change the file extension by simply renaming a file. As a text file datei.txtin datei.zipto rename. If you try to open it now, some operating systems assume that this is a ZIP archive , but fail when you try to open it because the file format itself has not been changed. To prevent the user from accidentally changing the file extension, some operating systems hide common file extensions by default.


Some operating systems and some individual programs are not able to recognize the type of a file without a suffix . Under some common operating systems, especially Windows and VMS , file extensions are assigned to specific applications ( file associations ). If you activate a file in a file manager , it will be opened with the assigned program.

Other operating systems, such as AmigaOS , macOS , classic Mac OS or Unix , have additional mechanisms for determining the file format or the purpose of a file and sometimes use the file extension for a more precise definition of the format or for other purposes (e.g. for specifying the version or platform for libraries). Sometimes a combination of both approaches is used; For example, the leaves KDE - desktop environment such. B. under Linux , initially to the file extension; if this is missing or is unknown in the system, an attempt is made to identify the type based on the content of the file. MacOS also uses a mixture of file extension and content to determine the file type.

The actually more advantageous identification of the file type in separately stored file metadata , a form of out-of-band signaling, was used, for example, in the classic Mac OS in the form of a special file area, the resource fork . In addition to the file type, the program to open it was also saved. On OS / 2 , too , the file type and associated program are stored in the metadata of each file in the HPFS file system .

On DOS for IBM PC-compatible PCs , which were most widespread in the 1980s and 1990s, no type of identification is used, except for the extension automatically assigned by the user or in part by the respective application program. On the operating system side, however, there is no check or warning in the event of an incorrect selection or change of the file name extension, which is also limited to three characters in accordance with 8.3 and is optional anyway.

On all operating systems, the file extension cannot be used to determine with certainty whether a file is actually in the specified file format. This is only possible if the file is opened and the content, for example the information in the file header ( magic number ) or characteristic character strings (data signature), are evaluated. However, not every file has a header, for example, simple text files , usually (but not always) with the extension .txt, do not have any mandatory special identification, because in 8-bit ASCII files the content begins directly with the first text character (text files with multibyte However, character sets often have a byte order mark ). The filetype of a file can be determined on a Unix command line .


On IBM - mainframe computers , the file extension is (also low level qualifier called) only used in the allocation of the right SMS (associate constructs DataClass , management class , storage class ). The ISPF editor also saves its profiles for each file extension. The data format itself is stored in the VTOC or in the VSAM catalog or in the tape header .

Under Unix and Unix -like operating systems , hidden files are marked with a period beginning and are therefore also referred to as "dot files". Under no circumstances does this introductory period indicate a filename extension. For example, it would .txtnot be a text file, but the hidden filename of the file txtwithout an extension.

In the WWW , where files are transferred via the Hypertext Transfer Protocol , it is not the file extension that is important, but the MIME type that is also sent, which in turn is usually determined from the extension. Most browsers determine the type of embedded images based on the magic number .

Since modern file systems support long file names, more than one period can appear in the file name. However, the file name extension itself does not normally have another point, although additives such as .bak(for English backup , backup does not invalidate) the previously standing original extension. For example, some text editors mark a backup copy of, Textdatei.txtfor example, as Textdatei.txt.bak. However, there is no standard. a. also Textdatei.bak(which means that the original file type is no longer visible as an extension) or Textdatei.txt~. It is also common for packing programs to keep the original file name extension if they (can) only compress individual files . Examples of this can traditionally be found primarily in the Unix environment, for example in compression withgzip or xz. These do not save the original file name in the archive itself, so the file name must still contain this information. For example, means Textdatei.txt.xzthat it is the one withxzcompressed file Textdatei.txt. In combination with tar archives, on the one hand more than one file can be compressed, on the other hand the original file names are stored in the tar archive. The compound file extensions used under Unix, e.g. B. .tar.gzfor a withgzipcompressed tar archives, were often too .tgzabbreviated in the past to get file names compatible with DOS and Windows ( 8.3 limitation). On systems with long file names, periods are also allowed in the file name that do not belong to the extension, for example

Under macOS (or since NextStep , by the macOS derived) are directories (under macOS "folder") with the extension .app(also .bundle, .framework, .pluginand .kext) as a container for application programs. These application bundles are displayed in the Finder as an "application", not as a directory, and, in addition to the actual program, contain all necessary resources, such as icons and the like. You can still navigate to the subdirectory in the Finder via the context menu entry "Show package contents".


On Windows systems, the default setting is that Windows Explorer hides all file extensions known to the system. This fact is exploited by various malicious programs : A harmless extension is inserted before the extension of an executable file. So z. B. from the Trojan horse named Bild01.exea Bild01.jpeg.exe. The user only sees Bild01.jpega supposedly harmless image file . However, a double click starts the malicious software. Such an attempted obfuscation becomes apparent by deactivating the standard masking of the known endings. Microsoft consciously accepts the security risk caused by the default hiding of the file extensions. Hiding or showing the endings can also affect the behavior of VBA scripts.

See also

Web links

Individual evidence

  1. Bundle Programming Guide - About Bundles. In: Documentation Archive. Apple, Inc., accessed October 19, 2019 .
  2. ^ Pearson Software Consulting: File Extensions And Their Implications In VBA Coding. (English)