[PLUG] Terminals and stdin
Jonathan Sergent
sergent@ETLA.NET
Thu, 09 Sep 1999 23:58:39 -0700
/// Jonathan Sergent <sergent@ETLA.NET>:
] Your terminal device (i.e. /dev/pts/1) is set to buffer lines when
] you log into the system.
[...]
I should also mention incidentally that if you are not reading from
a terminal (i.e. your stdin is hooked up to a file or a socket or
a pipe or something) then you will not get any buffering. And if
this is the case you should avoid calling tcgetattr() and tcsetattr()
since they will only generate errors. You can detect whether your
stdin is a tty with isatty().
--jss.