From: solamen2 AT hotmail DOT com (Edward Younskevicius) Newsgroups: comp.os.msdos.djgpp Subject: Re: Possible bug with fgets() and fputs(), ANSI C, in DJGPP Date: 10 Jan 2003 07:00:38 -0800 Organization: http://groups.google.com/ Lines: 18 Message-ID: <5d8a89c4.0301100700.2b8d37ca@posting.google.com> References: NNTP-Posting-Host: 130.181.95.217 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1042210838 15181 127.0.0.1 (10 Jan 2003 15:00:38 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: 10 Jan 2003 15:00:38 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 065211 AT bud DOT swin DOT edu DOT au (MURPHY, Jeremy W) wrote in message news:... > Younskevicius, Edward (FL51) (Edward DOT Younskevicius AT honeywell DOT com) wrote: > : Hello. Here is the description of what I think is a very peculiar bug, in > : regards to the ANSI C fgets() and fputs() in DJGPP. I am reading a file in > > > > If the file is open for both reading and writing, you must call > `fflush', `fseek', or `rewind' before switching from read to write or > from write to read. > > That's from the djgpp libc info, and could well be the solution. > Otherwise, I dunno. :) > > Jeremy fflush() did the trick. Silly thing to forget, really. Thanks so much - this error has been driving me up the wall for two days. - Ed