Binary I/O on stdin/stdout?

Richard A. O'Keefe ok at quintus.UUCP
Tue Apr 12 11:46:22 AEST 1988


In article <8042 at elsie.UUCP>, ado at elsie.UUCP (Arthur David Olson) writes:
[ Citation omitted by Olson]
> > If UNIX needed this facility, and if it used "b" to indicate binary mode,
> > 	FILE *binin = fdopen(fileno(stdin), "rb");
> > 	FILE *binout= fdopen(fileno(stdout),"wb");
> > 	/* use bin_in, bin_out instead of stdin, stdout */
> > would do the job.  Would this work in MSDOS?
> 
> Whether or not it works in MSDOS, it wouldn't work in draft proposed ANSI C
> (which lacks an "fdopen" function).

That's hardly news:  the point of the discussion was precisely that the
ability to do binary I/O on stdin/stdout was something that some people
needed and didn't appear to be available in dpANS.  The point of my message
was to suggest that instead of switching a stdio stream between several modes
it might suffice to be able to attach new streams to existing ports.



More information about the Comp.lang.c mailing list