.. include:: ../header.txt .. _stdin: .. _stdout: .. _stderr: .. _io: Standard Files and File Descriptors ===================================== :t:`Linux for Programmers and Users`, Section 3.5 .. seealso:: :ref:`redirect` .. index:: stdin, stdout, stderr When each program begins, three file descriptors are open and ready for use. .. describe:: stdin The primary input channel for the program. Default source is the user's keyboard, but it can easily be switched to be from another process via a pipe ( | ) or a file via a file redirection ( < ). .. describe:: stdout The primary output channel for program's data output. Default destination is the user's screen, but it can easily be switched to another process via a pipe ( | ) or a file via a file redirection ( > ). .. describe:: stderr Output channel for error messages. Default destination is the user's screen, but it can be switched to another process via a pipe ( | ) or a file via a file redirection ( > ). The details of how to do that will be covered later. See :ref:`redirect`. .. figure:: file_descriptors.png :align: center Logical view of file descriptors