|
Kansas State University at Salina Introduction to Unix |
|
Linux for Programmers and Users, Section 3.5
When each program begins, three file descriptors are open and ready for use.
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 ( > ).
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 ( < ).
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.
Logical view of file descriptors