ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. fileSetPos

Function

fileSetPos

Server and clientFilesIdentical to MTA:SA

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)

See also