Named pipe

From Christoph's Personal Wiki
Revision as of 06:54, 19 August 2006 by Christoph (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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