From: roland DOT nilsson AT communique DOT se (Roland Nilsson) Newsgroups: comp.os.msdos.djgpp Subject: Re: C-style FILE IO problems.. Date: 21 Dec 1996 11:12:19 GMT Organization: -+- Private -+- Lines: 30 Message-ID: <59ggmj$3l@news.luth.se> References: <59enik$foo AT news DOT luth DOT se> <32BB5A76 DOT 27EC1FC AT alcyone DOT com> NNTP-Posting-Host: x40.communique.se Mime-Version: 1.0 Content-Type: Text/Plain; charset=US-ASCII To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp In article <32BB5A76 DOT 27EC1FC AT alcyone DOT com>, max AT alcyone DOT com says... > >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) ??? > >How large? > >The only thing that comes to mind offhand: Are you trying to read binary >data? If so, are you sure you've opened the file in binary mode? (If not, >this would likely explain your problems, depending on your definition of >"they just bomb sometimes.") Yes, I'm parsing binary files. I believe C FILE i/o is always in raw mode. The only fopen() flags available are those relating to i/o direction and overwrite, according to my djgpp function list. I usually fopen() with "r". ----------------------------------------------------------- - - - Roland Nilsson, Pitea, SWEDEN --/ member of the \-- --( Avante OS Development Group )-- www.mediaport.org/~wierdo/ --\ (project coordinator) /--