Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!ucsd!hub!6600pete From: 6600pete@hub.UUCP Newsgroups: comp.unix.questions Subject: Re: fopen ( ..., "a" ) --- how does the "a" work? Message-ID: <3263@hub.UUCP> Date: 7 Dec 89 09:52:58 GMT References: Sender: news@hub.UUCP Lines: 33 From article <895@hsi86.hsi.UUCP-, by stevens@hsi.UUCP (Richard Stevens): - In article <3250@hub.UUCP-, 6600pete@hub.UUCP writes: -- When one opens a file under *most* flavors of UN*X -- with fopen ( ..., "a" ), the file mark is supposed to be moved to EOF -- before every write. Now, how is this done? Are there two system calls, -- one to move the file mark and one to do the write, or is there one -- system call, "append"? - - With System V Release 2, [ there is one system call ]. - I suspect the later release of System V also do this. - - Interesting, however, is that the 4.3BSD source differs. It does - an lseek to the EOF when fopen is called, and that's it. 4.3 does - have an O_APPEND option to open, but it doesn't appear to be used. From article