Name
hw_FSeek -- seek file to new position (V5.0)
Synopsis
ULONG oldpos = hw_FSeek(APTR handle, ULONG pos, int mode);
Function
This function seeks the file handle's read/write cursor to the specified position. Additionally, it returns the position of the read/write cursor before the seek operation. The specified position is relative to the seek mode passed in parameter 3. This can be one of the following modes:

HWFSEEKMODE_CURRENT:
New seek position is relative to the current position.

HWFSEEKMODE_BEGINNING:
New seek position is relative to the beginning of the file.

HWFSEEKMODE_END:
New seek position is relative to the end of the file.

To find out the current position of the read/write cursor, call hw_FSeek() with a 0 zero position and HWFSEEKMODE_CURRENT.

If there was an error, hw_FSeek() return -1.

Note that hw_FSeek() currently isn't able to handle negative seek positions. Thus, the value you pass in parameter 2 must always be positive.

Starting with Hollywood 6.0 there is also a 64-bit version of this command: See hw_FSeek64 for details.

This function is thread-safe.

Designer compatibility
Supported since Designer 4.0

Inputs
handle
file handle returned by hw_FOpen()
pos
destination seek position; this must not be negative!
mode
seek mode (see above)
Results
oldpos
previous position of file cursor or -1 on error

Show TOC