DLiteScript

io Namespace

I/O functions for reading and writing files and directories, creating and deleting files and directories, and for their existence.

io.appendFile

Appends data to a given file without replacing the original content. Part of the io namespace.

io.createDir

Creates an empty directory. Returns an error if the directory already exists. Part of the io namespace.

io.createFile

Creates an empty file. Returns an error if the file already exists. Part of the io namespace.

io.deleteDir

Deletes the given directory. Returns an error if the directory does not exist. Part of the io namespace.

io.deleteFile

Deletes the given file. Returns an error if the file does not exist. Part of the io namespace.

io.exists

Returns a tuple with a bool and an error based on whether the given file/dir exists or not. Part of the io namespace.

io.readFileString

Reads the content of a file and returns it as a string. Returns an error if the file does not exist. Part of the io namespace.

io.writeFile

Writes data to the given file. Returns an error if the file does not exist. Part of the io namespace.
Improve this page