- Documentation
- Shared functions
- fileSetPos
Function
fileSetPos
Sets the file position for the next read or write (e.g. fileGetSize = append at the end).
Syntax
int fileSetPos(file theFile, int offset)Arguments
theFilefile- A file handle.
offsetint- Position in bytes from the start.
Returns
The new position, or false.
Example
local file = fileOpen("log.txt")
fileSetPos(file, fileGetSize(file))
fileWrite(file, "kolejna linia\n")
fileClose(file)