Mail Archives: cygwin/1997/07/03/15:33:39
Hi,
I am having problems using fcntl() to change a file which was
opened in text mode that I'd like to use in binary mode. In particular,
I'd like to change my standard input and output (fd=0 and fd=1) to
binary so that I can create a filter program. Right now, I do:
#include <fcntl.h>
.....
flag = fcntl(0, F_GETFL);
flag |= _FBINARY;
fcntl(0, F_SETFL, flag);
.....
but this doesn't seem to work. As a matter of fact, flag seems to
retrieve some nonsensible value (perhaps the fd itself).
If this doesn't work, how much work-around do I need to do? I read that
an open() with O_BINARY would do the trick for new files. Perhaps I'll
give fdopen a try. Does fcntl() work right now?
Thanks for any help. Please email swift AT world DOT std DOT com.
Peter Lu
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -