An 8.3 filename[1] (also called a short filename or SFN) is a filename convention used by old versions of DOS, versions of Microsoft Windows prior to Windows 95, and Windows NT 3.51. It is also used in modern Microsoft operating systems as an alternate filename to the long filename for compatibility with legacy programs. The filename convention is limited by the FAT file system. Similar 8.3 file naming schemes have also existed on earlier CP/M, Atari, and some Data General and Digital Equipment Corporation minicomputer operating systems.
|
Contents
|
8.3 filenames have at most eight characters, optionally followed by a period "." and a filename extension of at most three characters. For files with no extension, the "." if present has no significance (that is "myfile" and "myfile." are equivalent). File and directory names are uppercase, although systems that use the 8.3 standard are usually case-insensitive.
VFAT, a variant of FAT with an extended directory format, was introduced in Windows 95 and Windows NT 3.5. It allowed mixed-case Unicode long filenames (LFNs) in addition to classic 8.3 names.
To maintain backward-compatibility with legacy applications (on DOS and Windows 3.1), an 8.3 filename is automatically generated for every LFN, through which the file can still be renamed, deleted or opened. The 8.3 filename can be obtained using the Kernel32.dll function GetShortPathName.[2][3]
Although there is no compulsory algorithm for creating the 8.3 name from an LFN, Windows uses the following convention:[4]
NTFS, a file system used by the Windows NT family, supports LFNs natively, but 8.3 names are still available for legacy applications. This can be optionally disabled to increase performance in situations where large numbers of similarly named files exist in the same folder.[5]
The ISO 9660 file system (mainly used on compact discs) has similar limitations at the most basic Level 1, with the additional restriction that directory names cannot contain extensions and that some characters (notably hyphens) are not allowed in filenames. Level 2 allows filenames of up to 31 characters, more compatible with Mac OS filenames.
During the Microsoft antitrust trials, the names MICROS~1 and MICROS~2 were humorously used to refer to the companies that might exist after a proposed split of Microsoft.[6]
This legacy technology is used in a wide range of products and devices, as a standard for interchanging information, such as compact flash cards used in cameras. VFAT LFN Long filenames introduced by Windows 95/98/ME retained compatibility. But the VFAT LFN used on NT-based systems (Windows NT/2K/XP) uses a modified 8.3 shortname.
If a filename contains only lowercase letters, or is a combination of a lowercase basename with an uppercase extension, or vice-versa; and has no special characters, and fits within the 8.3 limits, a VFAT entry is not created on Windows NT and later versions such as XP. Instead, two bits in byte 0x0c of the directory entry are used to indicate that the filename should be considered as entirely or partially lowercase. Specifically, bit 4 means lowercase extension and bit 3 lowercase basename, which allows for combinations such as "example.TXT" or "HELLO.txt" but not "Mixed.txt". Few other operating systems support this. This creates a backwards-compatibility problem with older Windows versions (95, 98, ME) that see all-uppercase filenames if this extension has been used, and therefore can change the name of a file when it is transported, such as on a USB flash drive. Current 2.6.x versions of Linux will recognize this extension when reading (source: kernel 2.6.18 /fs/fat/dir.c and fs/vfat/namei.c); the mount option shortname determines whether this feature is used when writing.[7]
A directory table is a special type of file that represents a directory. Each file or directory stored within it is represented by a 32-byte entry in the table. Each entry records the name, extension, attributes (archive, directory, hidden, read-only, system and volume), the date and time of creation, the address of the first cluster of the file/directory's data and finally the size of the file/directory.
Legal characters for DOS filenames include the following:
This excludes the following ASCII characters:
Code 0xE5 as the first byte (see below) makes troubles when Cyrillic KOI8 encoding is used, because it corresponds to Cyrillic capital letter "Е". Some operating systems such as ANDOS used to automatically change the letter to the similar-looking Latin one.[citation needed]
The DOS filenames are in the OEM character set.
Directory entries, both in the Root Directory Region and in subdirectories, are of the following format:
| Byte Offset | Length | Description | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x00 | 8 | DOS filename (padded with spaces)
The first byte can have the following special values:
|
|||||||||||||||||||||||||||
| 0x08 | 3 | DOS file extension (padded with spaces) | |||||||||||||||||||||||||||
| 0x0b | 1 | File Attributes
The first byte can have the following special values:
An attribute value of 0x0F is used to designate a long filename entry. |
|||||||||||||||||||||||||||
| 0x0c | 1 | Reserved; two bits are used by NT and later versions to encode case information | |||||||||||||||||||||||||||
| 0x0d | 1 | Create time, fine resolution: 10ms units, values from 0 to 199. | |||||||||||||||||||||||||||
| 0x0e | 2 | Create time. The hour, minute and second are encoded according to the following bitmap:
Note that the seconds is recorded only to a 2 second resolution. Finer resolution for file creation is found at offset 0x0d. |
|||||||||||||||||||||||||||
| 0x10 | 2 | Create date. The year, month and day are encoded according to the following bitmap:
|
|||||||||||||||||||||||||||
| 0x12 | 2 | Last access date; see offset 0x10 for description. | |||||||||||||||||||||||||||
| 0x14 | 2 | EA-Index (used by OS/2 and NT) in FAT12 and FAT16, High 2 bytes of first cluster number in FAT32 | |||||||||||||||||||||||||||
| 0x16 | 2 | Last modified time; see offset 0x0e for description. | |||||||||||||||||||||||||||
| 0x18 | 2 | Last modified date; see offset 0x10 for description. | |||||||||||||||||||||||||||
| 0x1a | 2 | First cluster in FAT12 and FAT16. Low 2 bytes of first cluster in FAT32. | |||||||||||||||||||||||||||
| 0x1c | 4 | File size |
Sometimes it may be desirable to convert a long filename to a short filename, for example when working with the command prompt. A few simple rules can be followed to attain the correct 8.3 filename.
1. A SFN filename can have at most 8 characters before the dot. If it has more than that, you should write the first 6, then put a tilde ~ as the seventh character and a number (usually 1) as the eighth. The number distinguishes it from other files with both the same first six letters and the same extension.
2. Dots are important and must be used even for folder names (if there is a dot in the folder name). If there are multiple dots in the long file/directory name, only the last one is used. The preceding dots should be ignored. If there are more characters than three after the final dot, only the first three are used.
3. Generally:
To find out for sure the SFN or 8.3 names of the files in a directory
use: "dir /x" shows the short names if there is one, and the long names.
or : "dir /-n" shows only the short names, in the original DIR listing format.
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)