tee command without buffering
Chris Torek
chris at umcp-cs.UUCP
Thu Dec 12 10:13:30 AEST 1985
In article <509 at brl-tgr.ARPA> kvancamp at ardc.arpa (LCWSL) writes:
> The fourth reply I got was from someone who said that what I wanted
> [`stopping buffering of the tee command'] is impossible because
> the buffering is inherent in the system (i.e., it isn't the fault
> of tee because tee already works on only one byte at a time).
Close. The problem is not in tee, but neither is it in the system:
It is in the command you are using on the left hand side of the
pipe. Most standard I/O libraries automatically line buffer file
output if the file itself is a terminal, and block buffer the output
otherwise. A careful program will use `fflush' at appropriate
points; indeed, I find that the `helpful' line buffering is
unnecessary and even problematical at times.
If a program behaves differently---aside of course from speed---when
its output is run through an unbuffered `cat'-like filter (e.g.,
`tee /dev/null'), it is not well written.
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP: seismo!umcp-cs!chris
CSNet: chris at umcp-cs ARPA: chris at mimsy.umd.edu
More information about the Comp.unix
mailing list