Garry's Mod Wiki

File:Seek

  File:Seek( number pos )

Description

Sets the file pointer to the specified position.

Arguments

1 number pos
Pointer position, in bytes.

Example

local f = file.Open( "test.txt", "w", "DATA" ) f:WriteFloat( math.pi ) f:WriteFloat( 66.99 ) f:Close() local f = file.Open( "test.txt", "r", "DATA" ) f:Seek( 4 ) print( f:ReadFloat() ) -- Prints 66.98999786377 f:Close()