Skip to content

FileHandle.seek

JoeStrout edited this page Sep 11, 2026 · 1 revision

Move the read/write position within the file

Parameters

Parameter Default Value Note
pos 0

Return value

None.

Notes

The position is clamped to the file: a negative value seeks to the start, and anything past the end seeks to the end.

Example

import "file"
fh = file.open("data.txt", "r")
print fh.readLine
fh.seek 0        // back to the beginning
print fh.readLine  // the same line again
fh.close

Clone this wiki locally