_FSeek( ) API Library Routine

See Also   Example

Moves the file pointer to a new location as specified by position and mode.

Syntax

long _FSeek(FCHAN chan, long position, int mode)
FCHAN chan;               /* File channel. */
long position;               /* Position in file. */
int mode;                     /* How to determine new location */

Remarks

If mode is 0 (absolute), the file pointer is set to the value of position. If mode is 1, (relative to file pointer), the value of position is added to the current file pointer position. If mode is 2 (relative to the end of the file), _FSeek( ) moves the file pointer past the end of the file. _FSeek( ) returns the new position of the file pointer. For example, _FSeek(chan, 0L, 2) moves the file pointer to the end of the file and returns the file length in bytes.

For more information on how to create an API library and integrate it with Visual FoxPro, see Chapter 28, Accessing the Visual FoxPro API, in the Programmer's Guide.