Fseek
From SA-MP Wiki
(Difference between revisions)
Revision as of 10:59, 1 May 2012 Vince (Talk | contribs) ← Previous diff |
Revision as of 23:30, 31 January 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
{{Scripting}} | {{Scripting}} | ||
- | {{Title}} | + | |
{{Description|Change the current position in the file. You can either seek forward or backward through the file.}} | {{Description|Change the current position in the file. You can either seek forward or backward through the file.}} | ||
Line 25: | Line 25: | ||
[[Category:Scripting Functions]] | [[Category:Scripting Functions]] | ||
[[Category:File Functions]] | [[Category:File Functions]] | ||
+ | |||
+ | [[fr:Fseek]] |
Revision as of 23:30, 31 January 2014
Description:
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. |
Return Values:
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.