In addition to directories, there are four other types of files
that can exist in the file system:
- A regular file is an identifiable (named) unit of text
or binary data information. A file can be C source code, a list of
names or places, a printer-formatted document, a string of numbers
organized in a certain way, an employee record containing smaller
information units in fields, a memo, and many other possible things.
A user or an application program must understand how to access and
use the individual increments of information (such as employee record
fields) within a file.
- A character special file defines one of the following:
- A terminal (/dev/ptypnnnn and /dev/ttypnnnn).
- The default controlling terminal for a process (/dev/tty).
- A null file (/dev/null). Data written to this file is discarded;
hence, it is known as the bit bucket. This file is always empty for
reading.
- A zero file (/dev/zero). Data written to this file is discarded
and binary zeros are supplied for any amount read from it.
- The random number files (/dev/random and /dev/urandom).
These files provide random numbers for cryptographic purposes.
- A file descriptor file (/dev/fdn or /dev/fd/n).
- A system console file (/dev/console). Data written to
this file is sent to the console using a write-to-operator (WTO) that
displays the data on the system console.
- A UNIX domain socket name
file. This is a path name that specifies the socket address for a UNIX domain socket.
The path name is assigned by the application programmer; there is
no convention for the name. The operating system creates the file.
- A Communications Server remote tty file (for example, rtynnnn)
that corresponds to the requesting terminal on the originating Communications
Server node. The name is assigned by the Communications Server administrator.
- The Communications Server character special file (/dev/ocsadmin)
that supports ioctl functions for Communications
Server administrative functions.
Character special files are dynamically created by the operating
system when they are first referenced. However, they can also be explicitly
created by a superuser (for instance, in order to assign different
permissions).
- A FIFO
special file is a file that is typically used to send data from
one process to another so that the receiving process reads the data
first-in-first-out (FIFO). A FIFO special file is also known as a named
pipe.
- A symbolic link is
a file that contains the path name for another file, in essence a
reference to the original file. Only the original path name is the
real name of the original file. You can create a symbolic link to
a file or a directory. In OS/390® V2R9
and later, /etc, /tmp, /dev, and /var are symbolic links.
An external
link is a type of symbolic link, a
link to an object outside of the HFS. Typically, it contains the
name of an MVS™ data set.
Users and programs create regular files, FIFO special files,
symbolic links, and external links.