files
Functions:
read
files.read(path: string): string
path
string
Path to the file
Returns contents of the specified file.
write
files.write(path: string, contents: string[, is_binary: boolean]): boolean
path
string
Path to the file
contents
string
Contents the file should be set to
is_binary
boolean
Is contents
a binary
Replaces contents of the specified file. Returns false
on failure.
create_folder
files.create_folder(path: string): boolean
path
string
New path to the folder
Creates a folder. Returns false
on failure.
create_file
files.create_file(path: string): boolean
path
string
New path to the file
Creates a file. Returns false
on failure.
exists
files.exists(path: string): boolean
path
string
Path to the file or folder
Checks if the file or folder exists. Returns false
if it does not exist.
list_dir
files.list_dir(path: string): table<string>
path
string
Path to the directory
Lists the names of all files and folders in the specified directory. Returns a string table
.
delete
files.delete(path: string): boolean
path
string
Path to the file or folder
Deletes a file or folder. Returns false
on failure.
Last updated