FileHandle.read

From MiniScript Wiki
Revision as of 02:14, 30 January 2025 by Redspark (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The read method of the FileHandle class returns a string containing the file contents starting from the current position and reading until the end of the file or a set number of code points.

Parameter Name Type Default Value Meaning
codePointCount number number of code points that need to be read in. Reads to the end of the file, if no parameter is supplied.

This will read the entire file into the variable data.

reader = file.open("fileToRead.txt", "r")
data = reader.read
reader.close