[comp.lang.c] binary stdin/stdout

john@viper.Lynx.MN.Org (John Stanley) (01/30/89)

  A friend and I were discussing some tools he is writing and we came
across a problem:

	How does one write portable code to access stdin and stdout in
	binary mode...?

  I know this isn't a problem if you just deal with ***x systems, but
what he wants to do requires being able to port this across many
different machines.  Anyone have a solution?

  PS:  Since I quite often don't have time to read news on the net,
email responses will be cheerfully accepted...  Anything really useful
I'll summarize and repost to the net..

  Advthanksance...

--- 
John Stanley (john@viper.UUCP)

gwyn@smoke.BRL.MIL (Doug Gwyn ) (01/31/89)

In article <1842@viper.Lynx.MN.Org> john@viper.Lynx.MN.Org (John Stanley) writes:
>	How does one write portable code to access stdin and stdout in
>	binary mode...?

You don't.  The three standard streams are preopened as text streams,
not binary, and there is no standard mechanism for changing this.  In
fact it may not even be possible to treat a text connection as binary
in some operating system environments.