FIFOs (named pipes) |
FIFOs are used for piping data between unrelated processes or if a entry for a pipe is needed in the file system. FIFOs are entries in the file system (that's why they are called named!) that behave like pipes - they can be written to and read from. Access is governed as usual for files.
An example of a FIFO is Solaris's
/var/spool/lp/fifos/FIFO
which is used by
lp to receive print requests. In an ls listing they appear with a
p
to indicate pipe
and a |
is appended to the name
if ls -F
is used:
prw-rw-rw- 1 lp lp 0 Jun 19 1998 FIFO|
FIFOs can be created with the shell
command mkfifo
or
the system call mkfifo( )
.
These in turn invoke the system call
mknod( )
which
can be used directly. The shell command
mknod filename p
may be used instead.
mknod
is the command for making a special file (a device file).
Last update: 2000 December 28