Skip to content

FileHandle.read

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Read up to byteCount bytes from the file (or all remaining if -1)

Parameters

Parameter Default Value Note
byteCount -1

Return value

Condition Return Value
(always) string

Notes

Example

import "file"
fh = file.open("data.txt", "r")
chunk = fh.read(4)   // read 4 bytes as a string
print chunk
fh.close

Clone this wiki locally