Filename extension: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Mobile edit Mobile web edit
fixed an error
Tags: Reverted nowiki added Visual edit
Line 2:
{{more citations needed|date=November 2015}}
A '''filename extension''', '''file name extension''' or '''file extension''' is a suffix to the [[filename|name]] of a [[computer file]] (for example, <code>.txt</code>, <code>.docx</code>, <code>.md</code>). The extension indicates a characteristic of the file contents or its intended use. A filename extension is typically delimited from the rest of the filename with a [[full stop]] (period), but in some systems<ref>{{cite manual
<nowiki> </nowiki><nowiki>|</nowiki> title = z/VM - Version 7 Release 1 - CMS Primer
<nowiki> </nowiki><nowiki>|</nowiki> id = SC24-6265-00
<nowiki> </nowiki><nowiki>|</nowiki> section = What Is a File?
<nowiki> </nowiki><nowiki>|</nowiki> section-url = https://www.ibm.com/servers/resourcelink/svc0302a.nsf/pages/zVMV7R1sc246265/$file/dmsb2_v7r1.pdf#page=21
| page = 7
| quote = One thing you need to know about creating files with z/VM is that each file needs its own three-part identifier. The first part of the identifier is the file name. The second part is the file type. And the third part is the file mode. These three file identifiers are often abbreviated fn ft fm.
| date = 2018-09-11
| url = https://w#include <iostream>
 
#include <string>
# include <iomanipstring>
# include <stringiomanip>
 
using namespace std;
Line 79 ⟶ 80:
The [[Multics]] file system stores the file name as a single string, not split into base name and extension components, allowing the "." to be just another character allowed in file names. It allows for variable-length filenames, permitting more than one dot, and hence multiple suffixes, as well as no dot, and hence no suffix. Some components of Multics, and applications running on it, use suffixes to indicate file types, but not all files are required to have a suffix — for example, executables and ordinary text files usually have no suffixes in their names.
 
File systems for [[UNIX-like]] operating systems also store the file name as a single string, with "." as just another character in the file name. A file with more than one suffix is sometimes said to have more than one extension, although terminology varies in this regard, and most authors define ''extension'' in a way that does not allow more than one in the same file name.{{cn|date=November 2023}} More than one extension usually represents nested transformations, such as <code>files.tar.gz</code> (the <code>.tar</code> indicates that the file is a [[tarTar (computing)|tar archive]] of one or more files, and the <code>.gz</code> indicates that the tar archive file is compressed with [[gzip]]). Programs transforming or creating files may add the appropriate extension to names inferred from input file names (unless explicitly given an output file name), but programs reading files usually ignore the information; it is mostly intended for the human user.
It is more common, especially in binary files, for the file to contain [[File format#Internal metadata|internal]] or [[File format#External metadata|external]] metadata describing its contents.
This model generally requires the full filename to be provided in commands, whereas the metadata approach often allows the extension to be omitted.
Line 91 ⟶ 92:
[[Windows 95]], with VFAT, introduced support for long file names, and removed the 8.3 name/extension split in file names from non-NT Windows.
 
The [[classic Mac OS]] disposed of filename-based extension metadata entirely; it used, instead, a distinct file [[type code]] to identify the file format. Additionally, a [[creator code]] was specified to determine which application would be launched when the file's [[Icon (computing)|icon]] was [[doubleDouble-click|double-clicked]]ed. <nowiki><ref></nowiki>{{cite web |title=Mac Creator and File Type codes |url=https://livecode.byu.edu/helps/file-creatorcodes.php|title=Mac Creator and File Type codes|accessdate=2022-09-02 |website=livecode.byu.edu}}<code><nowiki></ref></nowiki></code></ref> [[macOS]], however, uses filename suffixes as a consequence of being derived from the UNIX-like [[NeXTSTEP]] operating system, in addition to using type and creator codes.
 
In Commodore systems, files can only have four extensions: PRG, SEQ, USR, REL. However, these are used to separate data types used by a program and are irrelevant for identifying their contents.