language-icon Old Web
English
Sign In

Fork (file system)

In a computer file system, a fork is a set of data associated with a file-system object. File systems without forks only allow a single set of data for the contents, while file systems with forks allow multiple such contents. Every non-empty file must have at least one fork, often of default type, and depending on the file system, a file may have one or more other associated forks, which in turn may contain primary data integral to the file, or just metadata. In a computer file system, a fork is a set of data associated with a file-system object. File systems without forks only allow a single set of data for the contents, while file systems with forks allow multiple such contents. Every non-empty file must have at least one fork, often of default type, and depending on the file system, a file may have one or more other associated forks, which in turn may contain primary data integral to the file, or just metadata. Unlike extended attributes, a similar file system feature which is typically of fixed size, forks can be of variable size, possibly even larger than the file's primary data fork. The size of a file is the sum of the sizes of each fork. On file systems without forks, one may instead use multiple separate files that are associated with each other, particularly sidecar files for metadata. However, the connection between these files is not automatically preserved by the file system, and must instead be handled by each program that works on files. Another alternative is a container file, which stores additional data within a given file format, or an archive file, which allows storing several files and metadata within a file (within a single fork). This requires that programs process the container file or archive file, rather than the file system handling forks. These alternatives require additional work by programs using the data, but benefit from portability to file systems that do not support forks. File system forks are associated with Apple's Hierarchical File System (HFS). Apple's HFS, and the original Apple Macintosh file system MFS, allowed a file system object to have two kinds of forks: a data fork and a resource fork. The resource fork was designed to store non-compiled data that would be used by the system's graphical user interface (GUI), such as localizable text strings, a file's icon to be used by the Finder or the menus and dialog boxes associated with an application. However the feature was very flexible, so additional uses were found, such as splitting a word processing document into content and presentation, then storing each part in separate resources. As compiled software code was also stored in a resource, often applications would consist of just a resource fork and no data fork. One of HFS+'s most obscure features is that a file may have an arbitrary number of custom 'named forks' in addition to the traditional data and resource forks. This feature has gone largely unused, as Apple never added support for it under Mac OS 8.1-10.3.9. Beginning with 10.4, a partial implementation was made to support Apple's extended inline attributes. Until Mac OS X v10.4, users running the Unix command line utilities (such as tar) included with Mac OS X would risk data loss, as the utilities were not updated to handle the resource forks of files until v10.4. Starting in 1985, Novell NetWare File System (NWFS), and its successor Novell Storage Services (NSS), were designed from the ground up to use a variety of methods to store a file's metadata. Some metadata resides in Novell Directory Services (NDS), some is stored in the directory structure on the disk, and some is stored in, as Novell terms it, 'multiple data streams' with the file itself. Multiple data streams also allow Macintosh clients to attach to and use NetWare servers. NTFS, the file system introduced with Windows NT 3.1, supports file system forks known as alternate data streams (ADS). ReFS, a new file system introduced with Windows Server 2012, originally did not support ADS, but in Windows 8.1 64-bit and Server 2012 R2, support for ADS, with lengths of up to 128K, was added to ReFS.

[ "Unix file types", "Indexed file", "Distributed File System", "Versioning file system", "File Control Block" ]
Parent Topic
Child Topic
    No Parent Topic