Binary I/O on stdin/stdout?

Dave Jones djones at megatest.UUCP
Tue Mar 29 08:02:52 AEST 1988


in article <4250 at hoptoad.uucp>, gnu at hoptoad.uucp (John Gilmore) says:
> 
> I was just reading over the standard trying to figure out the differences
> between binary and text files and had a few realizations:
> 
>     *	Stdin, stdout, and stderr are assumed to be *text* files.
> A program that does binary I/O on them is not portable.  So, how does
> one fix this?
> 

> ...

On a Unix system, one writes a buffering package for raw bytes,
something akin to stdio, using write().  Since you don't need 
printf and scanf, it's no big deal.  Unfortunately, I have seen 
one implementation of C (IBM System 370) which 
does not have write().  Or if they do, they don't document it.



More information about the Comp.lang.c mailing list