Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!apple!uokmax!munnari.oz.au!murtoa.cs.mu.oz.au!ditmela!yarra!melba.bby.oz.au!leo!zvs From: zvs@bby.oz.au (Zev Sero) Newsgroups: comp.lang.c Subject: Re: Append mode ("a") query Message-ID: Date: 15 Feb 90 23:06:26 GMT References: <4992.25d9633c@uwovax.uwo.ca> Sender: news@melba.bby.oz.au Organization: Burdett, Buckeridge and Young Ltd. Lines: 27 In-Reply-To: chet@uwovax.uwo.ca's message of 14 Feb 90 18:55:08 GMT In a previous article chet@uwovax.uwo.ca writes: I know I'll be embarrassed because of this, but would someone please tell me why program A below, when executed twice contains twenty lines (i.e. the 2nd ten lines are inserted before the EOF mark), but program B positions its appends after the EOF mark (so that they don't appear when the file is typed out)? And what I can do to fix B. This happens on Turbo C and Small C (2.2), and I presume on every C compiler. [followed by example program A which works, and B which doesn't, even though the relevant code looks identical]. and in article <4992.25d9633c@uwovax.uwo.ca> he writes: In message 14089 I noted a problem with the "a" mode. This is to confirm that the C compiler on the Unix OS I use (Sun 4.0.1_Export) behaves the same way. Huh? In UNIX there is no such thing as an EOF marker, so how could "a" append after the EOF? I had assumed that your problem only happened in DOS. In any case, I compiled your program B with both gcc and cc under SunOS Release 4.0.3_EXPORT and also under Sun UNIX 4.2 Release 3.5EXPORT and it works fine in all four versions. -- Zev Sero - zvs@bby.oz.au Megalomaniacs are simply people who know damn well they can run the universe better then God or the present governors. - Abner Doon (Orson S. Card)