Binary and Text Modes and Stdin/Stdout 
Author Message
 Binary and Text Modes and Stdin/Stdout

I am aware that files can be openned with fopen in a text mode which does
end-of-line translation on some systems, or in binary mode which does
not, but is there a way to change the text/binary status of stdin/stdout?

TIA,
Steve.



Sat, 05 Feb 2005 00:49:36 GMT  
 Binary and Text Modes and Stdin/Stdout

Quote:

> I am aware that files can be openned with fopen in a text mode which does
> end-of-line translation on some systems, or in binary mode which does
> not, but is there a way to change the text/binary status of stdin/stdout?

freopen(NULL, "wb", stdout);


Sat, 05 Feb 2005 01:08:35 GMT  
 Binary and Text Modes and Stdin/Stdout

Quote:


>> I am aware that files can be openned with fopen in a text mode which does
>> end-of-line translation on some systems, or in binary mode which does
>> not, but is there a way to change the text/binary status of stdin/stdout?

> freopen(NULL, "wb", stdout);

Btw, note that it's implementation defined if the stdin/stdout/stderr
streams can be put into binary mode at all.


Sat, 05 Feb 2005 01:10:49 GMT  
 Binary and Text Modes and Stdin/Stdout
Groovy hepcat Rolf Magnus was jivin' on Mon, 19 Aug 2002 19:10:49
+0200 in comp.lang.c.
Re: Binary and Text Modes and Stdin/Stdout's a cool scene! Dig it!

Quote:
>> freopen(NULL, "wb", stdout);

>Btw, note that it's implementation defined if the stdin/stdout/stderr
>streams can be put into binary mode at all.

  Note also that freopen(NULL, ...) is undefined in C90. This is new
to C99.

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?



Mon, 07 Feb 2005 09:18:53 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Set stdin/stdout in binary on UNIX

2. binary stdin/stdout

3. Text mode or binary mode ?

4. Using STDIN in BINARY mode...

5. MSC6.0 - Binary Stdin Mode

6. Closing/reopening stdin in binary mode w/ Turbo C 2.0

7. Binary mode stdin

8. stdin as text vs. binary

9. stdin as text vs binary

10. reading text files in binary mode

11. Is stdprn opened in binary or text mode?

12. readable binary in text mode

 

 
Powered by phpBB® Forum Software