zWrite

Writes to an open file object.

Service:File System Services (64-Bit)
Version:OES 2

Syntax

#include <zPublics.h>

STATUS zWrite(
   Key_t        key,
   Xid_t        xid,
   QUAD         startingOffset,
   NINT         bytesToWrite,
   const void  *buffer,
   NINT        *retBytesWritten);

Parameters

key

(IN) Specifies the file object (as returned by zOpen or zCreate) being written.

xid

(IN) Specifies the transaction associated with this request. If the requested action is not part of a transaction, pass zNILXID.

startingOffset

(IN) Specifies the logical byte offset in the file object at which the write is to begin. If this is beyond the current end of file, the file is sparsely extended and leaves a hole in the file between the old EOF and this startingOffset.

bytesToWrite

(IN) Specifies the number of bytes to write to the file object.

buffer

(IN) Points to the data to be written to the file object.

retBytesWritten

(OUT) Points to the actual number of bytes written.

Return Values

zOK

The operation completed successfully.

non-0

An error occurred (see Section 4.1, Return Values for a description).

Remarks

zWrite writes the number of specified bytes from the buffer, starting at the startingOffset to the open file object identified by the key. The actual number of bytes written can be smaller than the requested number of bytes to be written.

See Also

zClose, zCreate, zFlush, zOpen, zRead, zSetEOF