Large File Support

Large file support, often abbreviated to LFS, is the term frequently applied to the ability to create files larger than either 2 GiB or 4 GiB on 32-bit operating systems.

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 larger than this, 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 remove the limitation.

In 1996, multiple vendors responded by forming an industry initiative known as the Large File Summit (thus "LFS" can be considered to stand for either "Large file support" or "Large File Summit"), tasked to define a standardized way to switch to 64-bit numbers to represent file sizes. (Merely ensuring the sizes were treated as unsigned numbers would only up the limit from 2 GiB-1 to 4 GiB-1, which would have been only a stopgap measure given the explosive growth in data storage. Nevertheless, Windows 95B / DOS 7.10 introduced an API extension to access files up to the full 4 GiB-1 bytes possible on FAT16B and FAT32 volumes. Applications not aware of this extension were still limited to a maximum of 2 GiB-1 bytes for backward compatibility reasons.) It is worth noting that 64-bit operating systems such as Tru64 UNIX never had a 32-bit limit to begin with, and hence needed no additional "large file support".

This switch caused deployment issues and required design choices 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 instead. (Some alternative file system implementations support an extension named FAT32+, which supports file sizes up to 256 GiB-1 in a mostly backward compatible way, but this extension is not supported in mainstream operating systems so far.)
  • 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 nor 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 architecture, and cannot be made larger without sacrificing backward compatibility. (This was resolved by introducing new functions fseeko and ftello. On Windows machines, under Visual C++, functions _fseeki64 and _ftelli64 are used.)
  • The above efforts notwithstanding, all applications had to be recompiled to make them LFS-aware. The resulting binaries were typically not runnable on older releases of the same operating system. This was, and to some extent still remains, a problem for some application vendors.

Famous quotes containing the words large, file and/or support:

    It is from quiet places like this all over the world that the forces accumulate which presently will overbear any attempt to accomplish evil on a large scale. Like the rivulets gathering into the river, and the river into the seas, there come from communities like this streams that fertilize the consciences of men, and it is the conscience of the world that we are trying to place upon the throne which others would usurp.
    Woodrow Wilson (1856–1924)

    A common and natural result of an undue respect for law is, that you may see a file of soldiers, colonel, captain, corporal, privates, powder-monkeys, and all, marching in admirable order over hill and dale to the wars, against their wills, ay, against their common sense and consciences, which makes it very steep marching indeed, and produces a palpitation of the heart.
    Henry David Thoreau (1817–1862)

    To suppose such a thing possible as a society, in which men, who are able and willing to work, cannot support their families, and ought, with a great part of the women, to be compelled to lead a life of celibacy, for fear of having children to be starved; to suppose such a thing possible is monstrous.
    William Cobbett (1762–1835)