OS Lecture 6
OS Lecture 6
SYSTEMS
INPUT, OUTPUT AND ERROR
REDIRECTION IN UNIX/LINUX
▪Linux redirection features can be used to detach the default
files from stdin, stdout, and stderr and attach other files with
them for a single execution of a command.
▪The act of detaching defaults files from stdin, stdout, and stderr
and attaching other files with them is known as input, output,
and error redirection.
UNIX/LINUX FIFOS
▪Anamed pipe (also called a named FIFO, or just FIFO) is a pipe whose
access point is a file kept on the file system.
▪ By
opening this file for reading, a process gets access to the FIFO for
reading.
▪ By
opening the file for writing, the process gets access to the FIFO for
writing. By default, a FIFO is opened for blocking I/O.
▪ This
means that a process reading from a FIFO blocks until another
process writes some data in the FIFO. The same goes the other way
around.
UNIX/LINUX FIFOS
▪ Unnamed pipes can only be used between processes that have an
ancestral relationship.
▪ And they are temporary; they need to be created every time and are
destroyed when the corresponding processes exit.