File System

readfile

<string> readfile(<string> path)

Returns the contents of the file located at path.


listfiles

<table<string>> listfiles(<string> path)

Returns a list of files and folders in the folder located at path. The returned list contains whole paths.


writefile

<nil> writefile(<string> path, <string> data)

Writes data to the file located at path if it is not a folder.


makefolder

<nil> makefolder(<string> path)

Creates a folder at path if it does not already exist.


appendfile

Appends data to the end of the file located at path. Creates the file if it does not exist.


isfile

Returns whether or not path points to a file.


isfolder

Returns whether or not path points to a folder.


delfile

Removes the file located at path.


delfolder

Removes the folder located at path.


loadfile

Generates a chunk from the file located at path. The environment of the returned function is the global environment.

If there are no compilation errors, the chunk is returned by itself; otherwise, it returns nil plus the error message.

chunkname is used as the chunk name for error messages and debug information.


dofile

Attempts to load the file located at path and execute it on a new thread.


Last updated