delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/01/10/10:15:07

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: <A0A49F49B15DD3118A9000805F95330D06CBE42B AT fl51m02 DOT space DOT honeywell DOT com> <avlqmm$3l7$1 AT c3p0 DOT cc DOT swin DOT edu DOT au>
NNTP-Posting-Host: 130.181.95.217
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:<avlqmm$3l7$1 AT c3p0 DOT cc DOT swin DOT edu DOT au>...
> 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
> 
> <snippety>
> 
> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019