Description of a file or another object referenced by a path.
In simple use a file system is a mechanism for organizing files and directories on a local storage device. In practice file systems are more capable and their contents more varied. For example, a path may refer to:
An operating system process that consumes data, produces data, or both. For example, reading from the
/dev/urandomfile on Linux returns a unique sequence of pseudorandom bytes to each reader.
A stream that connects a pair of programs together. A pipe is a special file that a producing program writes to and a consuming program reads from. Both programs operate concurrently. The size of a pipe is not well defined: the writer can write as much data as the reader is able to read.
A file on a remote file system. The performance and availability of remote files may be quite different from that of local files!
A symbolic link (symlink) to another path. When attempting to access this path the file system will follow the link and return data from the target path.
The same content as another path without a symlink. On UNIX file systems an inode is an anonymous handle to a file's content, and multiple paths may target the same inode without any other relationship to one another. A consequence of this design is that a directory with three 1 GiB files may only need 1 GiB on the storage device.
This class does not attempt to model these rich file system features! It exposes a limited view useful for programs with only basic file system needs. Be cautious of the potential consequences of special files when writing programs that operate on a file system.
File metadata is subject to change, and code that operates on file systems should defend against changes to the file that occur between reading metadata and subsequent operations.