Reads from an open file object.
#include <zPublics.h> STATUS zRead( Key_t key, Xid_t xid, QUAD startingOffset, NINT bytesToRead, void *retBuffer, NINT *retBytesRead);
(IN) Specifies the file object (as returned by zOpen or zCreate) that is to be read.
(IN) Specifies the transaction to which the request is bound. If the requested action is not part of a transaction, pass zNILXID.
(IN) Specifies which logical byte offset to begin reading in the file.
(IN) Specifies the number of bytes to read from the file.
(OUT) Points to the data that was read.
(OUT) Points to the number of bytes that were read.
zOK |
The operation completed successfully. |
non-0 |
An error occurred (see Section 4.1, Return Values for a description). |
zRead reads the number of bytes specified by bytesToRead bytes, starting at the startingOffset from the file identified by key. The actual number of bytes read might be smaller than the requested number of bytes to be read. The retBuffer is supplied by the caller and must be large enough to hold the requested data.