[net.unix-wizards] Reply to: stdio on ttys

Douglas@sri-unix (07/30/82)

Date: 28 Jun 1982 at 1729-CDT
As I demonstrated in my first response to your query, the standard STDIO
can certainly be used to obtain the desired terminal buffering behavior.
I have done this myself in an interactive graphics program of substantial
size (using an approach similar to the example I mailed you), and it
worked perfectly.

I have to take issue with the assertion that STDIO buffering behavior
has no effect on programs so long as flush is done before input, for two
reasons:
1) Some programs (such as screen editors) need to output to stdout
independently of the presence of a newline in their output stream;
2) Many programs such as "tee" assume standard behavior to the terminal,
and applications (shell scripts or system() subroutine) may well be
depending on this behavior.

I certainly don't argue that Bell code is "sacred" (there are some bugs
and remnants of poor design choices in several Bell programs), but the
STDIO package is a CRITICAL portability aid, especially in insuring
that one's code runs on non-UNIX systems, and any change in its
advertised behavior is SURE to cause portability problems at this late
date.  It would be especially unfortunate to bring on such problems
when there are adequate mechanisms within the existing interface.

It appears that your idea of correct terminal buffering behavior is based
on a particular scheme of usage; I've been using STDIO for efficient
terminal i/o interfaces for quite a while without having to build any
assumptions into STDIO itself.  You should feel free to make whatever
interface you wish, but it should be considered part of your application
and distributed as such, rather than asking other installations to
modify such a critical piece of support software.

I wonder what Dennis Ritchie's feedback on the suggestion would be?
It would be worth soliciting...
-------