Mail Archives: djgpp/1992/03/23/14:19:44
With all this talk of binary stdout not working, I had to run some
tests myself. I used the following program:
#include <stdio.h>
#include <fcntl.h>
extern void setmode(int, int);
int
main()
{
int i;
setmode(fileno(stdout), O_BINARY);
for (i = 0; i < 256; i++)
printf("%c", i);
return 0;
}
When I dump the output of this program to a file, I see that ALL bytes
are written correctly. If I pipe the output to xd, I see that all
bytes are still written correctly. However, if I let the output go to
the screen, the output stops after encoutering control-z.
So I guess you could say that binary stdout is broken, but it seems to
me that the only time you care about binary stdout is when you're
dumping it to a file or another program, and that works.
--
Eric Backus
ericb%hplsla AT hplabs DOT hp DOT com
(206) 335-2495
- Raw text -