files

Functions:

read

files.read(path: string): string

Name
Type
Description

path

string

Path to the file

Returns contents of the specified file.

write

files.write(path: string, contents: string[, is_binary: boolean]): boolean

Name
Type
Description

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

Name
Type
Description

path

string

New path to the folder

Creates a folder. Returns false on failure.

create_file

files.create_file(path: string): boolean

Name
Type
Description

path

string

New path to the file

Creates a file. Returns false on failure.

exists

files.exists(path: string): boolean

Name
Type
Description

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>

Name
Type
Description

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

Name
Type
Description

path

string

Path to the file or folder

Deletes a file or folder. Returns false on failure.

Last updated