mmioSeek

Syntax

LONG mmioSeek(hmmio, lOffset, iOrigin)

This function changes the current file position in a file opened with mmioOpen. The current file position is the location in the file where data is read or written.

Parameters

HMMIO hmmio

Specifies the file handle of the file to seek in.

LONG lOffset

Specifies an offset to change the file position.

int iOrigin

Specifies how the offset specified by lOffset is interpreted. Contains one of the following flags:

SEEK_SET

Seeks to lOffset bytes from the beginning of the file.

SEEK_CUR

Seeks to lOffset bytes from the current file position.

SEEK_END

Seeks to lOffset bytes from the end of the file.

Return Value

The return value is the new file position in bytes, relative to the beginning of the file. If there is an error, the return value is -1.

Comments

Seeking to an invalid location in the file, such as past the end of the file, may not cause mmioSeek to return an error, but may cause subsequent I/O operations on the file to fail.

To locate the end of a file, call mmioSeek with lOffset set to zero and iOrigin set to SEEK_END.