Line-by-line processing when stdin is not a tty

Nobody nobody at nowhere.com
Thu Aug 12 15:32:43 EDT 2010


On Wed, 11 Aug 2010 18:49:26 -0700, RG wrote:

> This doesn't explain why "cat | cat" when run interactively outputs 
> line-by-line (which it does).  STDIN to the first cat is a TTY, but the 
> second one isn't.

GNU cat doesn't use stdio, it uses read() and write(), so there isn't any
buffering.

For more complex programs, using unbuffered I/O may not be practical,
due to either code complexity or performance.




More information about the Python-list mailing list