.TH  "named pipe" "" "" Definition
.PC
.PP
.II FIFO
A
.I "named pipe"
is a special file created with the command
.BR /etc/mknod .
Unlike the block- and character-special files created by
.BR mknod ,
a named pipe is not
a device.
.PP
A named pipe acts like a conventional pipe set up between related processes.
It differs in that it has a visible name that
can be seen in a file system.
It also differs in that it has permissions
(since it's a file and has a name)
associated with it just like any other file.
This allows a named pipe to be accessed by processes that are
.I not
related to each other, and can even be used for processes that are running
on behalf of different users.
.PP
The following illustrates how one process can write data into
a named pipe and an unrelated process can read from it:
.DM
.ta 0.5i 3.0i
	/etc/mknod my_pipe p	# create the named pipe
	chmod 644 my_pipe	
	ls -lR / > my_pipe &	# pump data into pipe in background
	mail fred < my_pipe	# read from the pipe and process
.DE
.PP
This script creates a named pipe called
.B my_pipe
and makes sure that it is readable;
it then pumps a mass of data into the pipe (in the background),
and finally has a process read data from the named pipe and
perform some action on them (in this case, mail the data to user \fBfred\fR).
In this example,
the \fBmail\fR process could be running from
another login and could either be in the foreground or background.
.SH "See Also"
.Xr "libsocket," libsocket
.Xr "mkfifo()," mkfifo
.Xr "mknod," mknod.c
.Xr "pipe," pipe
.Xr "Using COHERENT" using_coh
.br
\*(PX Standard, \(sc5.4.2
