This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: FILE I/O: fread() fails for GCC(Cygnus & DJ's) and TC++
- To: Rich Kucera <Rich dot Kucera at ccmail dot irs dot gov>
- Subject: Re: FILE I/O: fread() fails for GCC(Cygnus & DJ's) and TC++
- From: "John D. Robertson" <john at rrci dot com>
- Date: Sat, 26 Apr 1997 13:20:51 -0400 (EDT)
- Cc: gnu-win32 at cygnus dot com
I ran into the same problem myself using MSVC++ - spent half a day
chasing it down. The fix for me was to open the file in "binary" mode
(whatever the hell that means!)
FILE *fh= fopen("yourfile", "rb");
Notice the mode is "rb", for read binary.
JDR
|======================================================|
| John D. Robertson, ADAMS Modeler / Software Engineer |
| Robertson & Robertson Consultants, Inc. |
| 3637 West Georgia Rd. |
| Pelzer, SC 29669 |
| |
| Phone: (864) 243-2436 |
| Fax: (864) 243-3023 |
| Email: john@rrci.com |
|======================================================|
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".