-
Notifications
You must be signed in to change notification settings - Fork 2
FileHandle.seek
JoeStrout edited this page Sep 11, 2026
·
1 revision
Move the read/write position within the file
| Parameter | Default Value | Note |
|---|---|---|
| pos | 0 |
None.
The position is clamped to the file: a negative value seeks to the start, and anything past the end seeks to the end.
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