fopen ( .., \"a\" ) --- how does the \"a\" work?

Kemp at DOCKMASTER.NCSC.MIL Kemp at DOCKMASTER.NCSC.MIL
Wed Dec 13 03:17:03 AEST 1989


Michael Meissner writes:
 > On a filesystem local to the machine, this [seeking to EOF] is
 > done atomically with the write call.  I'm not sure whether this
 > is guaranteed to be atomic under NFS, but I suspect not, particularly
 > if the NFS server is not a UNIX system (such as a VAX running VMS
 > or IBM mainframe).

This has *nothing* to do with the NFS server.  The client is responsible
for maintaining whatever state is associated with the open file,
including the seek position.

>From the NFS Protocol Spec, Version 2:

     NFSPROC_WRITE(writeargs)
     struct writeargs {
         fhandle file;
         unsigned beginoffset;
         unsigned offset;
         unsigned totalcount;
         opaque data<NFS_MAXDATA>;
     };

   'Writes "data" beginning at "offset" bytes from the beginning of
   "file".  The first byte of the file is at offset zero.  ...  The
   write operation is atomic.  Data from this call to WRITE will not
   be mixed with data from another client's calls.

   Note: The arguments "beginoffset" and "totalcount" are ignored and
   are removed in the next protocol revision.'


Dave Kemp <Kemp at dockmaster.ncsc.mil> "My sister is a yahoo"



More information about the Comp.unix.questions mailing list