Large-file support

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

Large-file support (LFS) is the term frequently applied to the ability to create files larger than either 2 or 4 GiB on 32-bit filesystems.


Traditionally, many operating systems and their underlying file system implementations used 32-bit integers to represent file sizes and positions. Consequently, no file could be larger than 232 − 1 bytes (4 GiB − 1). In many implementations, the problem was exacerbated by treating the sizes as signed numbers, which further lowered the limit to 231 − 1 bytes (2 GiB − 1). Files that were too large for 32-bit operating systems to handle came to be known as large files.

While the limit was quite acceptable at a time when hard disks were smaller, the general increase in storage capacity combined with increased server and desktop file usage, especially for database and multimedia files, led to intense pressure for OS vendors to overcome the limitation.

In 1996, multiple vendors responded by forming an industry initiative known as the Large File Summit to support large files on POSIX (at the time Windows NT already supported large files on NTFS), an obvious backronym of "LFS". The summit was tasked to define a standardized way to switch to 64-bit numbers to represent file sizes.[1]

This switch caused deployment issues and required design modifications, the consequences of which can still be seen:

  • The change to 64-bit file sizes frequently required incompatible changes to file system layout, which meant that large-file support sometimes necessitated a file system change. For example, Microsoft Windows' FAT32 file system does not support files larger than 4 GiB−1; one has to use NTFS or exFAT instead.
  • To support binary compatibility with old applications, operating system interfaces had to retain their use of 32-bit file sizes and new interfaces had to be designed specifically for large-file support.
  • To support writing portable code that makes use of LFS where possible, C standard library authors devised mechanisms that, depending on preprocessor constants, transparently redefined the functions to the 64-bit large-file aware ones.
  • Many old interfaces, especially C-based ones, explicitly specified argument types in a way that did not allow straightforward or transparent transition to 64-bit types. For example, the C functions fseek and ftell operate on file positions of type long int, which is typically 32 bits wide on 32-bit platforms, and cannot be made larger without sacrificing backward compatibility. (This was resolved by introducing new functions fseeko and ftello in POSIX.[2] On Windows machines, under Visual C++, functions _fseeki64 and _ftelli64 are used.)

See also[edit]


  1. ^ Solaris OS group (March 1996). "Large Files in Solaris: A White Paper" (PDF). Sun Microsystems. Archived from the original (PDF) on 2007-02-28. Cite journal requires |journal= (help)
  2. ^ "Adding Large File Support to the Single UNIX Specification". X/Open Base Working Group. 1996-08-14. Retrieved 2006-09-10. Cite journal requires |journal= (help)
  3. ^ Kuhnt, Udo; Georgiev, Luchezar; Davis, Jeremy (2007). "FAT+ draft revision 2" (FATPLUS.TXT) (2 ed.). Retrieved 2015-08-05.

External links[edit]