FileIO
Updated for version 3.38
FileIO
FileIO is an utility class that is meant to bring all file functions into one known class instead of io, SystemFS, and file. It also brings some more useful functions.
Remember that this class is called using a colon not a period.
At the moment, not all functions are supported in Linux. An asterisk will be written near functions to indicate that they don't support Linux. Also, make sure you're using the latest SuperBLT version as it may add support for some functions.
Functions
Get
Function | Return Type | Description |
---|---|---|
Open(String path, String flag) | File | Opens a file. Pretty much the same as io.open https://www.lua.org/manual/5.1/manual.html#pdf-io.open |
WriteTo(String path, Any data, String flags) | Boolean | Opens a file in |
ReadFrom(String path, String flags, String method) | String | Opens a file in |
ReadConfig(String path, Table tbl) | Table | Opens a custom XML file in |
ConvertScriptData(String/Binary data, String typ, Boolean clean) | Table | Converts |
ConvertToScriptData(Table data, String typ, Boolean clean) | String/Binary | Converts table |
ReadScriptData(String path, String typ, Boolean clean) | Table | Same as |
WriteScriptData(String path, Table data, String typ, Boolean clean) | Boolean | Opens a file in |
Exists(String path) | Boolean | Returns a boolean indicating if the file or directory in |
*CanWriteTo(String path) | Boolean | Returns true if path is writable. At the moment, returns true in Linux regardless |
GetFiles(String path) | Table | Returns a table of files in |
GetFolders(String path) | Table | Returns a table of folders in |
FileExists(String file) | Boolean | Returns true if a file in path |
DirectoryExists(String folder) | Boolean | Return true if a folder in path |
Other
Function | Description |
---|---|
*CopyFileTo(String path, String to_path) | Copies a file from |
*CopyDirTo(String path, String to_path) | Copies a folder from |
*CopyFilesToAsync(Table copy_data, Function callback) | An asynchronous copy of files. |
*CopyToAsync(String path, String to_path, Function callback) | Copies a directory in |
*MoveTo(String path, String to_path) | Moves file from |
*Delete(String path) | Deletes a file or directory in |
*DeleteEmptyFolders(String path, Boolean delete_current) | Deletes empty folders in directory |
MakeDir(String path) | Creates the directory |
LoadLocalization(String path, Boolean overwrite) | Loads a localization file (json) from |
Last updated