File

From Crumbled World Wiki

FileExampleCode

Constructor

function description
File(string filePath) Load a file.
File(string fileNodePath, string filePath) Load a file located in a map. load the file from the map with the name filePath.

Functions

return function description
string getName() Returns the file name.
string getPath() Returns the file path.
int getSize() Returns the file size.
int getLastWriteTime() Returns the time when the file was last updated.
bool isDirectory() Returns true if it is a directory,
bool exist() Returns if the file exist.
bool isFile() Returns true if it is a file.
string getContent() Returns the file content.
{File()} getFiles() Returns all files in the directory.
string getHash() Returns a hash of the file.
string saveToFile(string filePath) Save to file, The file will be saved in "Data/Dynamic" by default no fiole generated by lua can be saved in any other location.
string remove() Remove the file.