Turbo C and ^Z's

Doug Gwyn gwyn at smoke.brl.mil
Wed Jan 9 19:25:58 AEST 1991


In article <OTTO.91Jan7070856 at tukki.jyu.fi> otto at tukki.jyu.fi (Otto J. Makela) writes:
>In article <1991Jan04.173903.20643 at dirtydog.ima.isc.com> karl at 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.



More information about the Comp.lang.c mailing list