Difference between revisions of "Named pipe"

From Christoph's Personal Wiki
Jump to: navigation, search
 
 
Line 12: Line 12:
  
 
== See also ==
 
== See also ==
 +
* [[Job control]]
 
* [[mkfifo (command)|mkfifo]]
 
* [[mkfifo (command)|mkfifo]]
  

Latest revision as of 06:54, 19 August 2006

In computing, a named pipe (also FIFO for its behaviour) is an extension to the traditional pipe concept in Linux systems. A traditional pipe is "unnamed" because it exists anonymously and persists only for as long as the process is running. A named pipe is system-persistent and exists beyond the life of the process and must be "unlinked" or deleted once it is no longer being used. Processes generally attach to the named pipe (usually a file) to perform inter-process communication.

Named pipes in Linux

Instead of a conventional, unnamed, shell pipeline, a named pipeline is explicitly created using mknod or mkfifo, and two separate processes can access the pipeline by name.

For example, one can create a pipe and set up gzip to compress things piped to it

mkfifo pipe
gzip -9 -c < pipe > out

in a separate process, independently, one could perform

cat file > pipe

which would then perform the compression by gzip.

See also

External links