This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: fread/fwrite problems in b18
- To: B dot Amavasai at sheffield dot ac dot uk (Bala Amavasai)
- Subject: Re: fread/fwrite problems in b18
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- Date: Tue, 3 Jun 1997 19:19:53 +1000 (EST)
- Cc: gnu-win32 at cygnus dot com (Cygnus GNU-win32 mailing list)
Bala Amavasai, you wrote:
>
> Hi! I wonder if anyone can help. I've written a short program to remove a
> fix sized header (of 512 bytes) from a raw image file. However when I
> compile it and run under gcc b18, I do not get the output I expect. That
> is the output file size is always 30 bytes.
Change your calls to fopen() to open the files in binary mode, e.g.
use `fopen(filename, "rb")' rather than `fopen(filename, "r")',
and similarly use "wb" rather than "w". Or use binary mode mounts.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".