Psych Engine Logo
Psych Engine - Lua Script API

File I/O Functions

Functions for File Input/Output, allowing you to save and load external data.


getTextFromFile

getTextFromFile(path:String, ?ignoreModFolders:Bool = false):String

Loads a File as text and returns its content.
If the file couldn't be found, it will return null.

Examples:


saveFile

saveFile(file:String, content:String, ?absolute:Bool = false):Bool

Returns true if the file was saved successfully.

Examples:


deleteFile

deleteFile(file:String, ?ignoreModFolders:Bool = false, ?absolute:Bool = false):Bool

Returns true if the file existed and was deleted successfully.

Examples:


directoryFileList

directoryFileList(folder:String):Array<String>

Returns a table with the name of all files inside a mentioned path.


checkFileExists

checkFileExists(file:String, ?absolute:Bool = false):Bool

Returns true if the file input exists.

Examples: