Getchar w/wout echo
Leslie Mikesell
les at chinet.UUCP
Wed Aug 24 00:04:15 AEST 1988
In article <65197 at sun.uucp> alanf%smile at Sun.COM (Alan Fargusson) writes:
>I have always thought that this was an omission in the stdio I/O library.
>If turning echo on and off was defined as part of fread, fwrite, printf, ...
>then there would be no problem. As it is now you kind of take your chances
>with various version of UNIX, and non UNIX systems are hopeless (as far as
>portability that is).
Maybe... What if you want to run from a half-duplex terminal? There are
good reasons for this, like using a satellite link where there may be
a several-second delay in the echo. If stdio provided the echo, every
application would need to know how to turn if off. Handling it in the
OS/tty driver makes everything work automatically. Perhaps PC types don't
consider the possibility of having the keyboard and CPU separated by many
thousands of miles.
>It is to late to get this into the ANSI-C standard I guess.
It is questionable whether it belongs there. Perhaps there should be
a standard library interface to the OS or an emulation if the OS
doesn't provide the service. However, if an application routinely
enables echo it will cause trouble in environments where the echo is
provided elsewhere.
Les Mikesell
More information about the Comp.lang.c
mailing list