Mail Archives: djgpp/1996/12/21/13:11:42
Roland Nilsson wrote:
>
> I've been using djgpp for a few months, and has experienced some
> problems during heavy usage of C-style FILE io. It seems fread()
> and fwrite() cannot handle reads of any size, they fail in certain
> situations. I have not been able to find any logical pattern, they
> just bomb sometimes. Are there any restrictions on FILE usage which
> could explain this behaviour (maximum transfer sizes, reads at odd
> positions, etc) ???
Make sure you aren't using fread()/fwrite() with binary data on files in
text mode and then trying to use the data therefrom. Also, look in the
FAQ section dealing with struct sizes and packing to make sure you
aren't getting confused in the conversion from 16-bit code to 32-bit.
Something else to consider: are you checking the exit status of fread()
and fwrite() constantly? It's possible something other than file i/o is
causing the trouble; you could be running out of file descriptors,
overloading the transfer buffer, or any of a number of other things.
If you can reduce your code to the shortest sample program that displays
the erroneous behavior, and then post it here, we will be able to help
you more. A sample run of your program with appropriate calls to
perror() would also help.
Finally, make sure you have DJGPP v2.01, which is the latest version,
and that you aren't mixing programs from v2.01 and earlier versions.
You may also wish to browse the current list of DJGPP bug reports at
http://www.delorie.com/djgpp/bugs/ to see if anything there might
contribute to your problem.
Hope this helps...
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| Proud owner of what might one | http://www.cs.com/fighteer |
| day be a spectacular MUD... | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------
- Raw text -