Bug in od, cat, etc reading binary files

Eric De Mund ead@ixian.com
Mon Sep 22 01:30:00 GMT 1997


GNU-Win32 People,

    Joe Peterson <joe@jump.com> to <gnu-win32@cygnus.com>:
    ] Sorry if this is documented somewhere, but I could not find
    ] mention of it. I find that when, for example, using "od" to look
    ] at a binary file, if a ctrl-Z is encountered, the reading stops.
    ] This is because the fopen presumably does a "r" rather than a "rb"
    ] (a pc-ism).
    ]
    ] Other programs like "cat" and possibly others have this problem as
    ] well...

GNU-Win32 cat(1) does have this problem, as does md5sum(1), rendering
them significantly less useful. It's the understanding of this Unix
developer new to the Windows world that the equivalent of Microsoft's
Visual C++ 5.0 Run-Time Library function _setmode(3) is required (global
variable _fmode in that development world setting the default file-
translation mode of all files *except* stdin, stdout, and stderr).

Questions: How do I do these in the GNU-Win32 world? How do I:
    * set the analog of MSVC++5.0's _fmode
    * call the analog of MSVC++5.0's int _setmode(int handle, int mode)

Thank you,
Eric De Mund

"Magazines all too frequently lead to books and should be regarded by the
prudent as the heavy petting of literature." --Fran Lebowitz
--
Eric De Mund <ead@ixian.com>  |  PGP Key Fingerprint:
http://www.ixian.com/ead/     |  5349b223 af6c2081 eddd4c81 aac9d1a5
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list