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.
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.
Popular file systems that can use forks include Apple's
Alternatives
On file systems without forks, one may instead use multiple separate files that are associated with each other, particularly
Implementations
Apple
File system forks are associated with
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.[2] 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
In
Novell
Starting in 1985, Novell
Microsoft
NTFS, the file system introduced with Windows NT 3.1, supports file system forks known as alternate data streams (ADS).[5] ReFS, a new file system introduced with Windows Server 2012, originally did not support ADS,[6][7][8] but in Windows 8.1 64-bit and Server 2012 R2, support for ADS, with lengths of up to 128K, was added to ReFS.[9]
ADS was originally intended to add compatibility with existing operating systems that support forks.[
Uses
Sun
Extended attributes in
Possible security and data loss risks
When a file system supports different forks, the applications should be aware of them, or security risks can arise. Allowing legacy software to access data without appropriate shims in place is the primary culprit for such problems.[citation needed]
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:
- The user will never know the presence of any alternate fork nor the total size of the file, just of the main data fork.
- Computer viruses can hide in alternate forks on Windows and never get detected if the antivirus software is not aware of forks.
- Data can be lost when sending files via fork-unaware channels, such as e-mail, file systems without support for forks, or even when copying files between file systems with forks support if the program that made the copy does not support forks or when compressing files with software that does not support forks.
References
- ^ Apple (1996-07-02). "File Forks". Apple. Archived from the original on 2008-07-24. Retrieved 2006-11-18.
- ^ Bruce Horn. "The Grand Unified Model (1) - Resources". Folklore.org. Retrieved 2017-10-03.
- ^ Siracusa, John (28 April 2005). "Mac OS X 10.4 Tiger". Ars Technica.
- ^ "Command-line Backup Solutions on Mac OS X". Apple. 2005-10-29. Archived from the original on February 25, 2008. Retrieved 2006-11-18.
- ^ "Files and Clusters". Microsoft. 7 January 2021. Retrieved 2023-08-15.
- MSDN blogs. Archived from the originalon 16 February 2013. Retrieved 20 January 2013.
- CBS Interactive. Retrieved 21 January 2013.
- ^ Martin Lucas. "Windows Server 2012: Does ReFS replace NTFS? When should I use it?". TechNet. Archived from the original on 23 January 2013.
- ^ "Resilient File System Overview". Microsoft Docs. Microsoft. 13 January 2017. Retrieved 15 August 2023.
- ^ a b Law, Eric (7 September 2013). "Fun with Favicons". Microsoft Docs. Microsoft. Retrieved 15 August 2023.
- ^ Bart De Smet (2006-07-13). "Use Vista's DIR command to display alternate data streams". B# .NET Blog. Archived from the original on 2007-09-27. Retrieved 2007-07-07.
- ^ "FileSystem Provider (Windows PowerShell 3.0)". TechNet. Microsoft. 9 August 2012. Archived from the original on 23 January 2015.
- ^ a b Chen, Raymond (27 May 2011). "Why are custom properties created on Windows 2000 lost when I view the file from newer versions of Windows?". The Old New Thing. Microsoft. Retrieved 10 June 2020.
- ^ Microsoft (2006-10-27). "Indexing service adds data streams to image files". Microsoft. Retrieved 2006-11-18.
- ^ Chen, Raymond (1 May 2012). "What happened to the Summary information created on Windows 2000 and Windows XP?". The Old New Thing. Microsoft. Retrieved 10 June 2020.
- ^ Bart De Smet (2005-08-19). "Demo of "Attachment Execution Service internals" in Windows XP SP2 and Windows Server 2003 SP1". B# .NET Blog. Archived from the original on 2007-02-23. Retrieved 2006-11-18.
- ^ Chen, Raymond (4 November 2013). "Manipulating the zone identifier to specify where a file was download from". The Old New Thing. Microsoft.