Fseek

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
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.


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.


Return Values:

The 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.

In other languages