LRESULT mmioSeek(hmmio, lOffset, iOrigin) | |||
HMMIO hmmio; | |||
LONG lOffset; | |||
int iOrigin; |
The mmioSeek 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.
hmmio
Specifies the file handle of the file to seek in.
lOffset
Specifies an offset to change the file position.
iOrigin
Specifies how the offset specified by lOffset is interpreted. Contains one of the following flags:
Value | Meaning |
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. |
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.
Seeking to an invalid location in the file, such as past the end of the file, may cause mmioSeek to not 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.