Most files on a UNIX system are either regular files or directories, but there are additional types of files. The types are:
-
Regular file. The most common type of file, which contains data of some form. There is no distinction to the UNIX kernel whether this data is text or binary. Any interpretation of the contents of a regular file is left to the application processing the file.
One notable exception to this is with binary executable files. To execute a program, the kernel must understand its format. All binary executable files conform to a format that allows the kernel to identify where to load a program's text and data.
-
Directory file. A file that contains the names of other files and pointers to information on these files. Any process that has read permission for a directory file can read the contents of the directory, but only the kernel can write directly to a directory file. Processes must use the functions described in this chapter to make changes to a directory.
-
Block special file. A type of file providing buffered I/O access in fixed-size units to devices such as disk drives.
-
Character special file. A type of file providing unbuffered I/O access in variable-sized units to devices. All devices on a system are either block special files or character special files.
-
FIFO. A type of file used for communication between processes. It's sometimes called a named pipe.
-
Socket. A type of file used for network communication between processes. A socket can also be used for non-network communication between processes on a single host.
-
Symbolic link. A type of file that points to another file.