Jump to content

8.3 filename

From Alfawiki
8.3 filename
Company typeFilename format
IndustryComputer file systems
ProductsFile naming convention

An 8.3 filename—also referred to as a short filename or SFN—represents a filename format originally utilized by CP/M and early iterations of DOS and Microsoft Windows before the release of Windows 95 and NT 3.5. Despite its age, this naming scheme continues to be supported in contemporary Microsoft operating systems as an alternative to long filenames, preserving interoperability with older software. The FAT file system imposes limitations on this format, which shares similarities with naming conventions found in earlier systems such as CP/M, TRS-80, Atari, and certain minicomputer operating systems.

Overview

The 8.3 filename format permits a maximum of eight characters for the name portion, optionally followed by a period and a three-character extension. Systems restricted to 8.3 filenames disregard any characters exceeding these limits. When filenames lack extensions, trailing periods are considered negligible (for instance, is treated the same as ). Filenames are stored in uppercase and are case-insensitive, meaning is equivalent to . However, modern operating systems accessing 8.3 file systems may internally retain case distinctions to prevent truncation issues, as demonstrated in VFAT.

VFAT and automatic generation of 8.3 filenames

Introduced with Windows 95 and Windows NT 3.5, VFAT enhances the FAT file system by enabling mixed-case Unicode long filenames (LFNs) alongside traditional 8.3 names through multiple directory entries. To ensure backward compatibility with legacy DOS and Windows 3.1 applications, each LFN is automatically assigned a corresponding 8.3 filename. This short name allows files to be accessed, renamed, or deleted using legacy interfaces, though the generated short names (such as ) may bear little resemblance to their original long counterparts.

On NTFS volumes, the creation of these 8.3 filenames can be disabled globally to boost system performance, albeit at the risk of reduced compatibility. The short filename can be programmatically obtained using the Kernel32.dll function GetShortPathName.

Windows generally follows this procedure when producing 8.3 names from LFNs:

  1. If the LFN already conforms to uppercase 8.3 format, no separate short name is stored.
  2. If the LFN fits the 8.3 structure but includes mixed case letters, the LFN preserves mixed case while the short name is stored in uppercase.
  3. For longer or invalid names, spaces and other disallowed characters are removed or substituted (for example, becomes ), letters are capitalized, then truncated to six characters followed by a tilde (~) and a digit; this is appended with a period and a three-character extension.
  4. Starting with Windows 2000 on NT-based systems, when multiple files share similar prefixes causing naming conflicts, a hash-based truncation method generates unique short names.
  5. On Windows 95/98/ME systems, if more than nine collisions occur, additional truncation combined with two-digit suffixes resolves conflicts.

During the 2001 Microsoft antitrust trial, the short filenames MICROS~1 and MICROS~2 were playfully mentioned as hypothetical divisions of Microsoft.

NTFS, employed by Windows NT family operating systems, natively supports LFNs but continues to generate 8.3 names for compatibility with legacy applications such as Windows NTVDM. Disabling the creation of 8.3 filenames can enhance performance in directories containing many similarly named files; this setting can be adjusted on a per-volume basis or system-wide through utilities like or via registry modifications.

The ISO 9660 file system used for compact disc media imposes comparable filename restrictions at Level 1—limiting names without extensions and excluding certain characters—while Level 2 permits longer filenames consistent with classic AmigaOS and Mac OS standards.

On VFAT and NTFS file systems alike, 8.3 filenames utilize ANSI encoding to maintain backward compatibility.

The ReFS file system does not support the creation or use of 8.3 filenames.

Compatibility

This outdated technology continues to be extensively utilized in devices such as compact flash cards for cameras, acting as a common standard for data exchange. The VFAT long filename (LFN) system introduced by Windows 95/98/ME preserved backward compatibility, whereas NT-based operating systems (Windows NT/2000/XP) employ a modified 8.3 short filename scheme.

When a filename contains exclusively lowercase letters or combines a lowercase basename with an uppercase extension (or the reverse), lacks special characters, and adheres to the 8.3 format, Windows NT and subsequent versions omit creating a VFAT entry. Instead, case information is encoded using two bits located at byte 0x0c of the directory entry, permitting combinations such as or , but disallowing . This approach leads to compatibility challenges with older Windows editions (95, 98, ME), which present filenames in all uppercase and may alter capitalization during file transfers via USB drives. Operating systems that do not support DOS/Windows-style case insensitivity might face difficulties. Linux can interpret this extension when reading files; its use during writing is governed by the shortname mount option. For MS-DOS environments, Henrik Haftmann’s DOSLFN utility offers comparable capabilities.

Directory table

A directory table functions as a specialized file symbolizing a directory, where each file or subdirectory is represented by a 32-byte record. These entries store details such as the filename, extension, attributes (archive, directory, hidden, read-only, system, volume label), creation timestamp, starting data cluster address, and file size.

Permissible characters in DOS filenames include:

  • Uppercase alphabetic characters
  • Numerals
  • Space (with trailing spaces serving as padding; filenames containing spaces must be enclosed in quotes when using DOS commands)
  • Symbols: , , , , , , , , , , , , , , ,
  • Characters with values from 128 to 255 (subject to National Language Support limitations)

Characters excluded are:

  • , , , , , , , , =, , , , , , |
  • The dot () character within the name or extension except for special entries ( and )
  • Lowercase letters (which are stored as uppercase on FAT12/FAT16 filesystems)
  • Control characters ranging from 0 to 31 and DEL (127)

DOS filenames utilize the OEM character set. If code 0xE5 appears as the first byte, it may cause complications with extended ASCII symbols.

Directory entries within root and subdirectories follow this structure:

Byte Offset Length Description
0x00 8 DOS filename (padded with spaces)

Special values for the first byte include:

0x00 Entry is free; no further entries are occupied afterward
0x05 The actual initial character is 0xE5
0x2E 'Dot entry' representing either <syntaxhighlight lang="text" class="" style="" inline="1">.</syntaxhighlight> or <syntaxhighlight lang="text" class="" style="" inline="1">..</syntaxhighlight>
0xE5 Previously deleted entry; undelete tools restore this byte
0x08 3 DOS file extension (space-padded)
0x0b 1 File Attributes

Attribute bit definitions:

Bit Mask Meaning
0 0x01 Read Only
1 0x02 Hidden
2 0x04 System File
3 0x08 Volume Label
4 0x10 Subdirectory Flag
5 0x20 Archive bit
6 0x40 'Device' flag (reserved for internal use)
7 0x80 'Unused'

An attribute value of 0x0F signifies an entry for a long filename.

0x0c 1 'Reserved'; two bits here encode case distinctions in NT and later versions.

Additional fields capture creation date/time with fine granularity, last access date, EA-Index or high cluster bits for FAT32, last modification time/date, starting cluster number, and file size.

Working with short filenames in a command prompt

Utilizing short (8.3) filenames can simplify command prompt tasks. The main guidelines are as follows:

  1. A short filename (SFN) consists of up to 8 characters before the period. If the name exceeds this length, it is truncated to the initial 6 characters, followed by a tilde and a numeric digit (commonly 1) to distinguish duplicates.
  2. Only the final period in the filename is considered; any earlier periods are disregarded. The extension after this last dot is limited to its first three characters.
  3. Spaces are removed when converting to an SFN format.
  4. Characters such as commas, brackets, semicolons, equal signs, and plus symbols are replaced with underscores.
  5. Letter case does not matter; uppercase and lowercase letters are treated identically.

To check SFN listings within a folder:

  • Employ to reveal both short and long filename versions.
  • Employ to display exclusively short filenames.

On Windows NT platforms, the command prompt (cmd.exe) accommodates long filenames using wildcards , and filenames containing spaces must be enclosed in quotes.

Starting with Windows Vista, console commands and PowerShell provide limited wildcard pattern matching for filenames and subdirectories, automatically selecting the first matching item (for instance, navigates to ).