Skip to main content
Read and write files under Documents\Starline\scripts\data. Paths cannot escape this directory.

Paths

Paths are relative to the data folder. Both / and \ separate folders. Writes create parent folders. A bad path raises an error. Everything else below returns a value or nil/false plus an error string.

Read

The whole file as a string, or nil and an error. Bytes are returned as-is.

Write

Creates or replaces the file. content is a string.

Append

Adds to the end, creating the file if missing.

Exists

true for a file or folder.

Delete

Deletes a file, or an empty folder. Deleting something that isn’t there returns false, "not found".

List

Table of file names (no folders, not recursive), relative to the folder listed. A folder that doesn’t exist lists as empty.

Dir

Limits

Calls are synchronous. Files are shared between scripts, so use a script-specific subfolder.