Eyeon:Script/Reference/Libraries/io/seek
From VFXPedia
Contents |
IO: fh : seek
Arguments
fh:seek ([whence], [offset] )
- whence (optional, string)
a constant specifying the base from which the seek is performed.
- offset (optional, string)
a position in the file, specified in bytes.
Returns
The current position, measured as the number of bytes from the beginning of the file. If the call fails then seek returns nil, as well as a string describing the error.
Remarks
Sets and gets the current file position, measured in bytes from the beginning of the file, to a position specified by offset plus a base specified by the string whence. Whence can accept one of the following strings as input.
- "set"
base is position is zero : beginning of the file.
- "cur"
base is current position
- "end"
base is at the end of the file
The default value for whence is "cur" and for offset is 0. Therefore the call seek() will return the current file position; the call seek("set") sets the current position to the beginning of the file and returns zero; the call seek("end") sets the position to the end of the file and returns the file size in bytes.
Finally the call seek("cur", 8) would move the current position forward eight bytes and return that new position in the file.
Requirements
- eyeonScript 5.0
- Fusion 5.0
Examples
None at this time.