Getchar w/wout echo

Dan Mercer mercer at ncrcce.StPaul.NCR.COM
Tue Sep 13 07:20:41 AEST 1988


In article <7196 at haddock.ima.isc.com: karl at haddock.ima.isc.com (Karl Heuer) writes:
:mercer at ncrcce.StPaul.NCR.COM (Dan Mercer) writes:
::To expect portability across different hardware and operating system
::architectures, however, just because you write in 'C', stretches the meaning
::of portability.  One shouldn't expect the programming language to usurp the
::role of an operating system, or expect the interface of the language to the
::operating system to be the same in all instances.
:
:Why not?  That's exactly what stdio does, for example.  And several other
:system functions (rename(), remove()) are now part of the standard library
:which must be provided with every ANSI C implementation.
:
:On the other hand, fork() is not and should not be part of ANSI C.  So I think
:the real question is whether it's *possible* to standardize a reasonable form
:of raw I/O interface.  If so, I don't see any obvious reason not to do it.
:
:Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint

	Why not? Why not!!  Because character echo is a function of the
	output device,  not part of the character stream,  and the
	output device is part of the operating system,  not the 
	language.  Stdio's job is to format, input and output the 
	character stream,  not to control the device.

	Controlling echo is meaningless to non display input
	devices (like hard disks).  To mutilate stdio to know the
	type of input device it is getting the stream from is
	a violation.  And in systems with distributed processing
	(like NCR Towers,  where ioctl takes place in the HPSIO
	processor,  or LAN's,  where the ioctl may be distributed
	to the work stations) it isn't practical (what are you
	going to do,  send out change ioctl commands with every
	character input).

	Why don't you just find out how on your machine you turn off
	echo and roll your own programs to do stdio.  For your
	programs to be portable across different hardware schemes,
	and different operating systems,  you'll just have to do
	what the rest of us do - write code to port them.

	Dan Mercer
	NCR Comten



More information about the Comp.lang.c mailing list