📂Filesystem

filesystem namespace

Functions

read

fs.read("some_file.txt")

path

string

path to file

Returns:

data

string

read_stream

fs.read_stream("some_file.txt")

path

string

path to file

Returns:

data

table of char

write

fs.write("some_file.txt", "data")

path

string

path to file

data

string

data to write to file

write_stream

fs.write_stream("some_file.txt", {"a", "b", "c"})

path

string

path to file

data

table of char

data in bytes to write to file

remove

fs.remove("some_file.txt")

path

string

path to file

exists

fs.exists("some_file.txt")

path

string

path to file or directory

Returns:

true if file exists

boolean

is_file

fs.is_file("some_file.txt")

path

string

path to file

Returns:

true if path leads to a file

boolean

is_dir

fs.is_dir("some_file.txt")

path

string

path to directory

Returns:

true if path leads to a directory

boolean

create_dir

fs.create_dir("folder/some_directory")

path

string

path to directory

Last updated