Long filename

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Long filename (LFN) support is Microsoft's backward compatible extension of the 8.3 filename (short filename) naming scheme used in Microsoft DOS. Long filenames can be more descriptive, including longer extensions common on other operating systems such as .jpeg, .tiff, .html, and .xhtml rather than specialized shortened names such as .jpg, .tif, .htm, or .xht. The standard has been common with FAT filesystems since its first implementation in Windows NT 3.5 of 1994.

To maintain compatibility with older operating systems, Microsoft formulated a method of generating an 8.3 filename from the long filename (for example, Microsoft.txt to MICROS~1.TXT) and associating it with the file.

For more details on this topic, see Design of the FAT file system § VFAT long file names.

Compatibility issues[edit]

Microsoft implemented support for LFNs in the FAT filesystem by using hidden directory entries—of the volume label type—to store the longer names. This so-called VFAT scheme was chosen for compatibility; volume labels are generally ignored by programs and operating system components. Programs running on older operating systems could still access the files' short names, while newer, LFN-aware operating systems and programs could use the longer ones.

When LFN support was first introduced into an MS-DOS-based operating system in the form of Windows 95, it caused some problems for older programs. For example, a DOS program performing sector-level directory operations while Windows was in DOS mode could destroy long filename information so, by default, sector-level access to hard disks was disallowed in this mode.

Upon booting into plain DOS, the long filenames are not visible unless a VFAT LFN driver has been installed. Microsoft did not add LFN support to many of its older programs, including File Manager, the Windows for Workgroups file manager that was made obsolete by the new operating system shell, Explorer. Windows NT supported LFNs on NTFS file systems beginning with the release of NT 3.1, and all of its utilities, including File Manager, were updated to support LFNs. NT 3.5 added FAT LFN support in preparation for Windows 95. However, the Windows 95 version of File Manager came from Windows for Workgroups 3.11.

OS/2 stores LFNs for FAT filesystems in .LONGNAME extended attributes that are incompatible with Microsoft's implementation and only visible to tools supporting OS/2's standard. Many APIs providing access to files by pathname can not see the new, longer names without a supporting driver.


Because the FAT LFN implementation is layered on top of an older, more limited naming system, there are inevitable complications, such as if an attempt is made to create too many files with the same first six letters.[1] In addition, one is more likely to encounter issues creating files or folders in the root directory, since FAT12 and FAT16 only allocate space for 512 root directory entries on hard disks. Since long filenames use more than one directory entry, this problem may occur with fewer than 512 files or folders in the root directory.[2] There is space only for 25 long filenames of maximum length (512/20). This problem does not exist for FAT32 volumes.

The long filename system allows a maximum length of 255 UCS-2 characters[3][4] including spaces and non-alphanumeric characters (excluding the following characters, which have special meaning within the command interpreter or the operating system kernel: \ / : * ? " < > |). This is achieved by chaining up to 20 directory entries of 13 2-byte unicode characters each.[4] The maximum length of a pathname is 256 characters, which includes all parent directories and the filename. 255-character mixed-case long filename is possible only for files or folders with no sub-folders at the root folder of any drive.

VFAT LFN drivers[edit]

The following is a list of drivers that can be used to provide support for VFAT long file names as used in Windows 95. Although drivers such as DOSLFN can be loaded in almost any versions of DOS, it works best on DOS versions that have support for LFN themselves, such as MS-DOS 7.10, so that DOS commands such as DIR would show long file names as well.

OS Driver Name Provider
any DOS DOSLFN, LFNDOS third-party
OS/2 VFAT-OS2.IFS third-party

Other implementations[edit]

Before LFN support was implemented into the FAT family of file systems, various file managers provided their own methods to attach and maintain longer file descriptions. Among the first to do so are the alternative command line processors 4DOS and NDOS with their internal DESCRIBE command and corresponding DESCRIPT.ION files. The latter are optional hidden files located in each directory storing a line-based list of file names located in the directory together with their textual description and optional metadata entries—for example, extended attributes and configuration data for other programs. The descriptions can be up to 511 characters long and are displayed along the file names in much the same way as long file names are listed alongside their short filename aliases in DIR listings. If an entry exists for a file, it will be copied and moved with the file for as long as these command line processors are used to perform the operation.[5] This scheme is still maintained by successors such as 4OS2, 4NT, Take Command, and Take Command Console. It has been adopted also by various other programs like VC, DN, ODN, NDN, Windows Commander, Total Commander, XnView, ACDSee, Newsbin Pro, V, and some CUI_LIB[6]-based applications.[citation needed]

Human68K, the operating system of the Sharp X68000 computers since 1986, is based upon an extended FAT file system. It allows up to 18.3 characters in a filename (instead of the 8.3 in FAT) and allows also upper and lower case characters (as well as Kanji in Shift JIS code) that are all treated as distinctive. If restricted to the use of 8.3-format filenames with upper case characters only, the Human68K floppies are fully compatible with the Japanese 1232 KiB standard FAT floppy format (77 cylinders, 2 heads, 8 sectors, 1024 bytes/sector). This format is used by the NEC PC-9800, Fujitsu FMR and FM Towns series computers.[citation needed]

Novell NetWare versions 3.x and 4.x volumes can also support Microsoft-compatible long filenames, by loading an additional NetWare Loadable Module (NLM).[7]

See also[edit]


  1. ^ CocoaDev: MSDOSFileSystem
  2. ^ Errors Creating Files or Folders in the Root Directory
  3. ^ Making Room for Long Filenames
  4. ^ a b Long Filename Specification
  5. ^ Conn, Rex; Rawson, Tom; Paul, Matthias; Dye, Charles; Georgiev, Luchezar (2002-02-27). 4DOS 8.00 online help. 
  6. ^ Paul, Matthias (1997-05-01). "Hinweise zu JPSofts 4DOS 5.5b/c, 5.51, 5.52a und NDOS". MPDOSTIP (in German). Retrieved 2015-05-08.  The provided link points to a HTML-converted version of the 4DOS5TIP.TXT file rather than the actual MPDOSTIP package.
  7. ^ Novell (February 11, 1999). "TID1002030 Windows NT, Long File Names on Netware". 

External links[edit]