Date: Mon, 13 Dec 1999 10:43:11 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Juergen Buchmueller cc: djgpp-workers AT delorie DOT com, DJ Delorie Subject: Re: [pullmoll AT t-online DOT de: libc bug report] In-Reply-To: <199912130034.TAA03406@envy.delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Sun, 12 Dec 1999 13:36:02 +0100 > From: pullmoll AT t-online DOT de (Juergen Buchmueller) > X-Accept-Language: en > To: dj AT delorie DOT com Thanks for your report. > I stumbled across a flaw in DJGPPs implementation of the fopen() libc > function - specificially the "a" append mode. It's a known bug: the library currently handles "a" and O_APPEND only when the file is opened, but it doesn't ``remember'' that information afterwards. (Frankly, I'm amazed that it took so long for someone to complain. AFAIK, this bug exists since DJGPP v2.0 hit the streets; I found out about it by chance, simply from examining the sources, about half a year ago.) > I hope it'll be easy to fix it. Unfortunately, it isn't. DOS doesn't have an ``append'' bit in any of the functions that open/create files. So this requires to save the O_APPEND bit in some internal library data structure and use some non-trivial logic based on that bit to reset the file position before each write. Unless some disaster strikes, this should be fixed in v2.04.