Reposition within an open file.
long _lseek (int handle, long offset, int origin);
long lseek (int handle, long offset, int origin);
Required Header |
<io.h> |
Return Value
Each of these functions returns the new file position, relative to the begining of the file. -1 indicates an error.
Parameters
handle
A handle to the open file
offset
A character offset from the origin
origin
One of the following constants:
SEEK_SET the begining of the fileRemarks
The _lseek function repositions file handle by, possibly rewinding the file, then reading the number of bytes required by the seek operation, to the required position. It is not possible to extend a file by positioning past the End Of File in the JCC library.
The file read operation in this instance uses a special read mode which bypasses the buffer calculations which normally occur when reading a file in the JCC library.