Long filename

Last updated

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

Contents

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.

Compatibility issues

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 scheme is known as VFAT, and was chosen for compatibility, as volume labels are generally ignored by programs and operating system (OS) components. Programs running on older OSs could still access the files' short names, while newer, LFN-aware OSs and programs could use the longer ones.

When LFN support was first introduced into a 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 is installed. Microsoft did not add LFN support to many of its older programs, including File Manager, the Windows 3.1x (Windows for Workgroups) file manager that was made obsolete by the new operating system shell, Windows Explorer. Windows NT supported LFNs on NTFS file systems starting 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 cannot see the new, longer names without a supporting driver.

Limits

Because the FAT LFN implementation is layered atop 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] Also, 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 24 long filenames of maximum length (512/(1+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.COM 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.

While long filename support allows for longer file and directory names, under DOS-based systems, the absolute file path constructed from the associated short file and directory name equivalents is still represented in an internal data structure called the Current Directory Structure (CDS), [5] [6] [7] [8] which imposes a limit of 66 characters on the (short) path name and thereby indirectly limits also the path depth to a maximum of 33 levels (counting in the root directory and assuming only single-letter names). (This design limitation was not present in older versions of DR DOS (prior to DR DOS 6.0 November 1991 updates) which still utilized a relative path representation internally, [7] [8] [9] however, due to their internal differences these versions are not compatible with existing LFN add-on drivers.) Non-DOS-based operating systems without a CDS are not restricted to this path depth limitation.

VFAT LFN drivers

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 or DR-DOS 7.02, so that DOS commands such as DIR would show long file names as well.

OSDriver nameProvider
any plain DOS DOSLFN, LFNDOSthird-party
DR-DOS LONGNAMEincluded
RxDOS built-inincluded
OS/2 VFAT-OS2.IFSthird-party
Windows NT 4.0 NTLFNthird-party

Driver-less real mode DOS LFN commands

Some small real mode DOS programs have also been written over the years, although many have been lost over time. One notable collection of programs that still exists is LFN Tools, which is open source and comprises seven useful LFN commands written in C++ and assembly language, with documentation included in English and German, and is available at LFNTOOLS on Sourceforge.net.

Other implementations

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. [10] 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. [9] This scheme is still maintained by successors such as 4OS2, 4NT / Take Command. It was adopted also by various other programs like Volkov Commander (VC), DOS Navigator (DN), Open DOS Navigator (ODN), Necromancer's DOS Navigator (NDN), Windows Commander, Total Commander, Double Commander, 7-Zip, XnView, ACDSee, Newsbin Pro, V, FreeDOS [11] and some CUI_LIB [12] -based applications.

Human68K, the operating system of the X68000 computers since 1986, is based on 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). [13]

In order to support Java applications without implementing a VFAT-compatible scheme, the FlexOS-based IBM 4690 OS version 2 introduced its own virtual file system (VFS) architecture to store long filenames in the FAT file system in a backwards compatible fashion. If enabled, the virtual filenames (VFN) are available under separate logical drive letters, whereas the real filenames (RFN) remain available under the original drive letters. [14]

See also

Related Research Articles

File Allocation Table (FAT) is a file system developed for personal computers and was the default filesystem for MS-DOS and Windows 9x operating systems. Originally developed in 1977 for use on floppy disks, it was adapted for use on hard disks and other devices. The increase in disk drives capacity required four major variants: FAT12, FAT16, FAT32, and ExFAT. FAT was replaced with NTFS as the default file system on Microsoft operating systems starting with Windows XP. Nevertheless, FAT continues to be used on flash and other solid-state memory cards and modules, many portable and embedded devices because of its compatibility and ease of implementation.

<span class="mw-page-title-main">Drive letter assignment</span> Alphabetical assignment to logical drives on computers (e.g., C:\)

In computer data storage, drive letter assignment is the process of assigning alphabetical identifiers to volumes. Unlike the concept of UNIX mount points, where volumes are named and located arbitrarily in a single hierarchical namespace, drive letter assignment allows multiple highest-level namespaces. Drive letter assignment is thus a process of using letters to name the roots of the "forest" representing the file system; each volume holds an independent "tree".

An 8.3 filename is one that obeys the filename convention used by old versions of DOS and versions of Microsoft Windows prior to Windows 95 and Windows NT 3.5. It is also used in modern Microsoft operating systems as an alternate filename to the long filename, to provide 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, TRS-80, Atari, and some Data General and Digital Equipment Corporation minicomputer operating systems.

Linux has several filesystem drivers for the File Allocation Table (FAT) filesystem format. These are commonly known by the names used in the mount command to invoke particular drivers in the kernel: msdos, vfat, and umsdos.

<span class="mw-page-title-main">COMMAND.COM</span> Default command line for MS-DOS and Windows 9x

COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot. As a shell, COMMAND.COM has two distinct modes of operation: interactive mode and batch mode. Internal commands are commands stored directly inside the COMMAND.COM binary; thus, they are always available, but can only be executed directly from the command interpreter.

A filename extension, file name extension or file extension is a suffix to the name of a computer file. 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 it is separated with spaces.

In computing, the working directory of a process is a directory of a hierarchical file system, if any, dynamically associated with the process. It is sometimes called the current working directory (CWD), e.g. the BSD getcwd function, or just current directory. When a process refers to a file using a simple file name or relative path (as opposed to a file designated by a full path from a root directory), the reference is interpreted relative to the working directory of the process. So for example a process with working directory /rabbit-shoes that asks to create the file foo.txt will end up creating the file /rabbit-shoes/foo.txt.

<span class="mw-page-title-main">4DOS</span> Command line interpreter

4DOS is a command-line interpreter by JP Software, designed to replace the default command interpreter COMMAND.COM in Microsoft DOS and Windows. It was written by Rex C. Conn and Tom Rawson and first released in 1989. Compared to the default, it has a large number of enhancements.

An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

<span class="mw-page-title-main">Filename</span> Text string used to uniquely identify a computer file

A filename or file name is a name used to uniquely identify a computer file in a file system. Different file systems impose different restrictions on filename lengths.

A path is a string of characters used to uniquely identify a location in a directory structure. It is composed by following the directory tree hierarchy in which components, separated by a delimiting character, represent each directory. The delimiting character is most commonly the slash ("/"), the backslash character ("\"), or colon (":"), though some operating systems may use a different delimiter. Paths are used extensively in computer science to represent the directory/file relationships common in modern operating systems and are essential in the construction of Uniform Resource Locators (URLs). Resources can be represented by either absolute or relative paths.

<span class="mw-page-title-main">DOSKEY</span>

DOSKEY is a command for DOS, IBM OS/2, Microsoft Windows, and ReactOS that adds command history, macro functionality, and improved editing features to the command-line interpreters COMMAND.COM and cmd.exe.

AUTOEXEC.BAT is a system file that was originally on DOS-type operating systems. It is a plain-text batch file in the root directory of the boot device. The name of the file is an abbreviation of "automatic execution", which describes its function in automatically executing commands on system startup; the filename was coined in response to the 8.3 filename limitations of the FAT file system family.

The process of filename mangling, in computing, involves a translation of the file name for compatibility at the operating system level. It occurs when a filename on a filesystem appears in a form incompatible with the operating system accessing it. Such mangling occurs, for example, on computer networks when a Windows machine attempts to access a file on a Unix server and that file has a filename which includes characters not valid in Windows.

A file system API is an application programming interface through which a utility or user program requests services of a file system. An operating system may provide abstractions for accessing different file systems transparently.

In computer data storage, a volume or logical drive is a single accessible storage area with a single file system, typically resident on a single partition of a hard disk. Although a volume might be different from a physical disk drive, it can still be accessed with an operating system's logical interface. However, a volume differs from a partition.

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching and looping within the batch file, such as IF, FOR, and GOTO labels. The term "batch" is from batch processing, meaning "non-interactive execution", though a batch file might not process a batch of multiple data.

<span class="mw-page-title-main">DOS</span> Family of IBM PC-compatible operating systems

DOS is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible systems from other manufacturers include DR-DOS (1988), ROM-DOS (1989), PTS-DOS (1993), and FreeDOS (1998). MS-DOS dominated the IBM PC compatible market between 1981 and 1995.

The FAT file system is a file system used on MS-DOS and Windows 9x family of operating systems. It continues to be used on mobile devices and embedded systems, and thus is a well-suited file system for data exchange between computers and devices of almost any type and age from 1981 through to the present.

<span class="mw-page-title-main">MS-DOS 7</span> Computer operating system

MS-DOS 7 is a real mode operating system for IBM PC compatibles. Unlike earlier versions of MS-DOS, it was not released separately by Microsoft, but included in the Windows 9x family of operating systems. Windows 95 RTM reports it as MS-DOS 7.0, and Windows 95 OSR 2.x and Windows 98 report as 7.1. The real-mode MS-DOS 7.x is contained in the IO.SYS file.

References

  1. "MSDOSFileSystem". CocoaDev. 2005-09-12. Archived from the original on 2006-10-18.
  2. "Errors Creating Files or Folders in the Root Directory". Microsoft. 120138.
  3. Winnick Cluts, Nancy (August 1996) [January 1995]. "Making Room for Long Filenames". Files and I/0 Technical Articles. Microsoft Corporation. 810456. Archived from the original on 2008-04-23. Retrieved 2007-04-19.
  4. 1 2 Dobiash, Jack "vinDaci", ed. (1998-01-06) [1996-11-18]. "Long Filename Specification" (4 ed.). Grand Ronde, Oregon, USA. Archived from the original on 2015-10-25. Retrieved 2013-05-22.
  5. Schulman, Andrew; Brown, Ralf D.; Maxey, David; Michels, Raymond J.; Kyle, Jim (1994) [November 1993]. Undocumented DOS: A programmer's guide to reserved MS-DOS functions and data structures - expanded to include MS-DOS 6, Novell DOS and Windows 3.1 (2 ed.). Reading, Massachusetts: Addison Wesley. ISBN   0-201-63287-X. ISBN   978-0-201-63287-3. (xviii+856+vi pages, 3.5-inch floppy) Errata:
  6. Brown, Ralf D.; et al., eds. (2000-07-16). "Ralf Brown's Interrupt List" (61 ed.). INTER61.
  7. 1 2 Paul, Matthias R. (1997-07-30) [1994-05-01]. NWDOS-TIPs Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds. MPDOSTIP (in German) (3 ed.). Archived from the original on 2017-09-10. Retrieved 2014-08-06. (NB. NWDOSTIP.TXT is a comprehensive work on Novell DOS 7 and OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.)
  8. 1 2 Paul, Matthias R. (1997-06-07) [April 1994]. "Chapter 1.3.xi: Überlange Pfade". NWDOS7UN.TXT — Zusammenfassung der dokumentierten und undokumentierten Fähigkeiten von Novell DOS 7. MPDOSTIP (in German). Archived from the original on 2016-11-07. Retrieved 2016-11-07.
  9. 1 2 Brothers, Hardin; Rawson, Tom; Conn, Rex C.; Paul, Matthias R.; Dye, Charles E.; Georgiev, Luchezar I. (2002-02-27). 4DOS 8.00 online help.
  10. "Technical Note -- Using DESCRIPT.ION". Chestertown, Maryland, USA: JP Software Inc. 1989. Archived from the original on 2016-03-18. (NB. Known IDs include 0x23 ('#') as used by various utilities written by Matthias R. Paul for space-separated lists of text key=value pairs holding file properties as extended attributes like CP (codepages), PC (language codes), CW (bit-width), XS (page width), YS (page length), XO (print x-offset), YO (print y-offset), CR (copyright), URL (source link), etc., 0x25 ('%') being used by programs using CUI_LIB to store pseudo-environment variables, 0xED being reserved for Digital Research/Novell/Caldera and 0xFD for FreeDOS.)
  11. Davis, Jeremy. "FreeCom and 4DOS DESCRIPT.ION files" (FreeDOS tech note). FreeDOS. Archived from the original on 2016-11-11. Retrieved 2016-11-11.
  12. Paul, Matthias R. (1997-05-01) [1995-03-01]. "Hinweise zu JPSofts 4DOS 5.5b/c, 5.51, 5.52a und NDOS". MPDOSTIP (in German). Archived from the original on 2016-11-04. Retrieved 2015-05-08. (NB. The provided link points to a HTML-converted version of the 4DOS5TIP.TXT file, which is part of the MPDOSTIP.ZIP collection.)
  13. Novell (1999-02-11). "TID1002030 Windows NT, Long File Names on NetWare". Archived from the original on 2011-06-06. Retrieved 2007-12-03.
  14. 4690 OS Programming Guide Version 5.2 (PDF). IBM. 2007-12-06. IBM document SC30-4137-01. Archived (PDF) from the original on 2022-01-25. Retrieved 2018-09-03.