Skip to main content
Returns the full contents of the file at path as a single string.
path is workspace-relative. There’s no encoding step - you get the exact bytes that are on disk, so binary files read fine too.

Parameters

Returns

string - raw contents of the file. The string can contain any byte value, including embedded "\0" and binary data.

Example

Load a saved config back into a Lua table:
Always check isfile() before reading to avoid runtime errors.