
In computer file systems, a fork is additional data associated with a file system object. A file system might support only one fork per file or might support multiple named forks. Unlike extended attributes, which are typically limited in size, a fork can be of arbitrary size, possibly even larger than the file's data.
Contents |
File system forks are traditionally associated with Apple's Hierarchical File System (HFS),[1] but are also available in other file systems. In Microsoft's NTFS they are known as Alternate Data Streams (ADS).[2] Other filesystems such as Novell's Novell Storage Services (NSS) and NetWare File System (NWFS), Solaris's UFS (in Solaris 9 and later)[3] and ZFS, and Veritas Software's Veritas File System (VxFS) also support file system forks. In Solaris they are known as extended attributes, although they can be as large as a file and are accessed in the same way a file's data is and thus behave like a fork. UDF, being a universal file system for general data exchange, supports forks as well.
Apple's HFS, and the original Apple Macintosh file system MFS, were designed to allow a file to have a resource fork to store metadata that would be used by the system's graphical user interface (GUI), such as a file's icon to be used by the Finder or the menus and dialog boxes associated with an application.[4] However the feature was not limited to GUI data, so additional uses were found, such as splitting a word processing document into content and presentation, then storing the presentation information in the resource fork. One particular non-obvious use is that prior to Mac OS X, PostScript Type 1 fonts have traditionally been stored entirely in the resource fork, the data fork being empty[5]. In addition, old 680x0 applications had all of their code in the resource fork as 32K segments which were loaded on demand[6].
Starting in 1985, NWFS and its successor 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.
In 1993, Microsoft released the first version of the Windows NT operating system which introduced the NTFS filesystem. This filesystem includes support for multiple named forks as alternate data streams for compatibility with pre-existing operating systems that support forks. With Windows 2000, Microsoft started using alternate data streams in NTFS to store things such as author or title file attributes[7] and image thumbnails.[8] With Service Pack 2 for Windows XP, Microsoft introduced the Attachment Execution Service that stores details on the origin of downloaded files in alternate data streams attached to files, in an effort to protect users from downloaded files that may present a risk.[9]
When a filesystem supports different forks, the applications should be aware of them, or security risks can arise.
If the different system utilities (disk explorer, antivirus software, archivers, and so on), are not aware of the different forks, the following problems can arise:
Windows NT versions include the ability to use forks in the API, and some command line tools can be used to create and access forks, but they are ignored by most programs, including Windows Explorer and the DIR command. Windows Explorer copies forks and warns when the target file system doesn't support them, but only counts the main fork's size and it doesn't list a file or folder's streams. The DIR command has been updated in Vista to include an option that will list forks.[10] Until Mac OS X v10.4, users using 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[11].
Why are we here?
All text is available under the terms of the GNU Free Documentation License
This page is cache of Wikipedia. History