Fseek
From SA-MP Wiki
Change the current position in the file. You can either seek forward or backward through the file.
(File:handle, position, whence)
| handle | The File handle to use, earlier opened by fopen(). |
| position | The new position in the file, relative to the parameter whence. |
| whence | The starting position to which parameter position relates. |
| Returns | The new position, relative to the start of the file. |
| Note: To get the current file position without changing it, set the position
parameter to zero and whence to seek_current. |
Whences
| seek_start | Set the file position relative to the start of the file (the position parameter must be positive). |
| seek_current | Set the file position relative to the current file position: the position parameter is added to the current position. |
| seek_end | Set 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.
- fopen: Open a file.
