Long filename

From Wikipedia, the free encyclopedia

Long filenames (LFN), spelled "long file names" by Microsoft[1], are longer and therefore more descriptive filenames supported by the Microsoft FAT filesystem. Earlier versions of the filesystem restricted filenames to eight characters and a three-character extension (referred to as a DOS 8.3 filename). The first Microsoft Windows operating system to implement long filenames on FAT was Windows NT 3.5 in 1994.

The long filename system allows a maximum length of 255 UTF-16 characters[2] [3], 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]

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 technical details of the implementation, please refer to the File Allocation Table article.

Contents

[edit] Compatibility issues

The way Microsoft added support for LFNs to the FAT filesystem was by adding hidden directory entries, of "volume label" type, to the filesystem to store the longer names. The reason they chose to do this was compatibility: volume labels are generally ignored by programs and operating systems. Programs running on older operating systems could still access the files while newer operating systems and programs can access long file names.

When LFNs were first introduced into a MS-DOS based operating system with Windows 95 the implementation caused some problems when people used older programs. 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 locked out in this mode.

Also if booting into plain DOS the long filenames would not be visible, unless an LFN driver is installed (see below). At the same time Microsoft decided not to update many of the older programs to support LFNs. Of those, one that particularly stands out is the program File Manager, the Windows for Workgroups 3.11 file manager (which has been made obsolete by the new operating system shell, the Explorer). Windows NT supported LFNs on NTFS file systems since the release of NT 3.1, and all of its utilities, including the File Manager, was updated to support LFNs, and NT 3.5 added FAT LFN support in preparation for Windows 95, however the Windows 95 version of File Manager came from Windows for Workgroup 3.11.

OS/2 had its own method of supporting LFNs on FAT drives, incompatible with Microsoft's. They were stored as a .LONGNAME extended attribute, were mostly just "labels", only visible in tools designed to display them, and most annoyingly not available for accessing files by pathname at the API level. However this can be rectified with a driver.

[edit] Limitations

Because 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.[5]

[edit] LFN drivers

The following is a list of drivers that can be used to provide support for long file names used in Windows 95:

OS Driver Name Provider
OS/2 VFAT OS2 3rd party
DOS DOSLFN 3rd party
DR-DOS LFNDOS Provided

[edit] Similar implementations

Prior to the release of OS/2 and Windows NT, one of the first file systems to support long names and spaces was the Macintosh File System, written for the original version of Mac OS on the Macintosh 128K released in January 1984. Although the Macintosh File System supported file names up to 255 characters in length, at the time Finder only allowed up to 63 characters. With the release of the Hierarchical File System (HFS) in September 1985, the maximum file name length allowed by the file system was reduced to 31 characters.[6] When the Finder was re-written for System 7, the maximum file name length was dropped to 31, matching the maximum allowed by the file system.[6] In January 1998, Apple released Mac OS 8.1 with HFS Plus, which included support for 255 character file names; however, Finder continued to limit names to 31 characters until Mac OS X.[7]

AmigaOS in 1985 allowed up to 30 characters in a filename.

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

[edit] See also

[edit] References

  1. ^ Microsoft Corporation
  2. ^ Making Room for Long Filenames
  3. ^ Long Filename Specification
  4. ^ Long Filename Specification
  5. ^ CocoaDev: MSDOSFileSystem
  6. ^ a b Apple Computer (July 15, 1992). Technical Note FL515: File Manager File Handling Q&As. Apple Developer Connection. Apple Computer. Retrieved on 2006-12-20.
  7. ^ Apple Computer (January 30, 1998). Technical Note TN1121: Mac OS 8.1. Apple Developer Connection. Apple Computer. Retrieved on 2006-12-20.
  8. ^ TID1002030 Windows NT, Long File Names on Netware (February 11th, 1999).

[edit] External links

Languages