Fseek

From SA-MP Wiki

Jump to: navigation, search


Change the current position in the file. You can either seek forward or backward through the file.


Parameters:
(File:handle, position, whence)
handleThe File handle to use, earlier opened by fopen().
positionThe new position in the file, relative to the parameter whence.
whenceThe starting position to which parameter position relates.


ReturnsThe new position, relative to the start of the file.


Image:32px-Ambox_warning_orange.png Note: To get the current file position without changing it, set the position

parameter to zero and whence to seek_current.


Whences

seek_startSet the file position relative to the start of the file (the position parameter must be positive).
seek_currentSet the file position relative to the current file position: the position parameter is added to the current position.
seek_endSet the file position relative to the end of the file (parameter position must be zero or negative).


Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools