delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/02/12/15:22:43

Date: Mon, 12 Feb 2001 22:21:57 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <3791-Mon12Feb2001222157+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
CC: djgpp-workers AT delorie DOT com
In-reply-to: <200102121851.TAA22673@father.ludd.luth.se> (message from Martin
Str|mberg on Mon, 12 Feb 2001 19:51:00 +0100 (MET))
Subject: Re: Bug000323
References: <200102121851 DOT TAA22673 AT father DOT ludd DOT luth DOT se>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
> Date: Mon, 12 Feb 2001 19:51:00 +0100 (MET)
> 
> But I still see no bug; the "hello there"s end up at the end. Any
> ideas on how to get it to manifest itself?

Try lseek instead of fseek.

fseek is too smart: it won't issue an lseek unless it's really needed,
and it's not simple to force it to do that.  An explicit lseek is much
simpler.

In any case, just by examining the source of fflush you should be able
to see that it doesn't take care to position the file at the end,
before it calls _write.  That is certainly a bug.  (Of course, having
a program which actually shows the bug is a Good Thing ;-)

- Raw text -


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