

named pipe                  Definition                 named pipe




A  _n_a_m_e_d  _p_i_p_e  is  a  special  file  created  with  the  command
/eettcc/mmkknnoodd. Unlike the block- and character-special files created
by mmkknnoodd, a named pipe is not a device.

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 _n_o_t related to each other, and can
even  be  used  for  processes  that  are running  on  behalf  of
difference users.

The following  illustrates how one process can  write data into a
named pipe and an unrelated process can read from it:


     /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


This script  creates a named  pipe called mmyy_ppiippee  and makes sure
that it is  readable; it then pumps a mass  of data into the pipe
(in the  background), and then  has a process read  data from the
named pipe  and perform some  action on them (in  this case, mail
the data  to use ffrreedd).  In this example,  the mmaaiill process could
be  running from  some other  login  and could  either be  in the
foreground or background.

***** See Also *****

ddeeffiinniittiioonnss, mmkknnoodd, ppiippee






















COHERENT Lexicon                                           Page 1


