Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!uvaarpa!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Turbo C and ^Z's Message-ID: <14791@smoke.brl.mil> Date: 9 Jan 91 08:25:58 GMT References: <1991Jan04.173903.20643@dirtydog.ima.isc.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 18 In article otto@tukki.jyu.fi (Otto J. Makela) writes: >In article <1991Jan04.173903.20643@dirtydog.ima.isc.com> karl@ima.isc.com (Karl Heuer) writes: > Lars is correct. On a file opened in append-mode, fseek() is only useful > for reading. (Though some historical implementations implemented append- > mode with an initial seek-to-end only, this is not acceptable in ANSI C.) >Yes. Confirm. Affirmative. Now that I've gone thru it, this seems to be >how it works. I didn't realize ANSI decided to break compatibility with Unix >in such a radical way... I get mighty tired of claims that "ANSI C breaks compatibility with ...". In fact there are instances of UNIX that use O_APPEND for stdio "a" modes. On some primitive UNIX implementations lacking O_APPEND, an imperfect simulation of appending was implemented by performing just the initial seek to EOF. A proper implementation on such systems would have had to seek to EOF before each write operation. Note that the notion of appending to a file does not work well with multiple concurrent (buffered) writers.