Binary I/O on stdin/stdout?

Chris Torek chris at mimsy.UUCP
Mon Mar 28 01:44:40 AEST 1988


In article <4250 at hoptoad.uucp> gnu at hoptoad.uucp (John Gilmore) writes:
>    *   There seems to be *no way* to "reopen" [stdin and stdout] as
>binary.

I believe this is the case.  I thought at one point that

	freopen((char *)NULL, "rb", stdin);

was supposed to do that sort of thing, but apparently that was just
a proposal; it never made it into any draft.  (This seems to me a
not unreasonable way to do it.  Systems that do not have modes need
only say

	if (name == NULL && stream_is_open(stream))
		return (stream);

while those that do can do whatever is required at system startup
and file open time to figure out what modes are permissible and to
retain whatever state is needed to set them.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list