Lua · Variables · Storage and web

files

Text files in the script's own data folder.

Only scripts/data/<script>/. Names use letters, digits, _, . and -, up to 64 characters, and cannot start with a dot. 1 MB per file, 64 files.

FunctionWhat it does
files.read(name)The file contents, or nil.
files.write(name, text)Writes (replaces) a file.
files.list()File names in the folder.
files.remove(name)Deletes a file.

#files.read

files.read(name)

The file contents, or nil.

Returns

string | nil
-

#files.write

files.write(name, text)

Writes (replaces) a file.

Returns

boolean
-
Example
files.write("kills.csv", table.concat(rows, "\n"))

#files.list

files.list()

File names in the folder.

Returns

string[]
-

#files.remove

files.remove(name)

Deletes a file.

Returns

boolean
-