File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 614614\end {slide }
615615
616616\begin {itemize }
617- \item Note the flag \texttt {O\_ APPEND } used to implement a redirection
618- \texttt { >> } .
617+ \item Note the flag \texttt {O\_ APPEND } used to implement the \texttt { >> }
618+ redirection .
619619\item \hlabel {REDIRECT} Another example of \texttt {dup } use will be provided when
620620we start working with pipes. The first redirection example from the slide
621621(without \texttt {stderr }) is in \example {read/redirect.c}. In that example, the
622622\texttt {execl } call replaces the current process image with the
623623program passed in the first argument. We got ahead of ourselves here though, we
624624will learn about the \texttt {exec } calls on page \pageref {EXEC }.
625625\item To fully understand how redirection works it is good to draw the file
626- descriptor table for each step and where the slots point to. In
626+ descriptor table for each step and where the slots point to. In
627627the \nth {2} example in the slide above, we have the initial state, after
628628\texttt {close(1) } and \texttt {open("out", ...) }, and the final state, as
629629follows:
634634+-------+ +-------+ +-------+
635635| 1 +-> stdout ==> | 1 +-> "out" ==> | 1 +-> "out"
636636+-------+ +-------+ +-------+ /
637- | 2 +-> stderr | 2 +-> stderr | 2 +---'
637+ | 2 +-> stderr | 2 +-> stderr | 2 +---'
638638+-------+ +-------+ +-------+
639639\end {verbatim }
640640
You can’t perform that action at this time.
0 commit comments