DeleteDir
This function deletes a directory.
Syntax
- bool DeleteDir(string path, bool recursive=false)
Parameters
- path: the file path of the directory to delete.
- recursive: if set to true, the function will delete all contents of the directory, otherwise the directory will not be deleted if it contains files.
Remarks
This function will have no effect if Lua sandboxing is enabled.
Example
--Create a folder
local path = "MyDir"
FileSystem:CreateDir(path)
--Delete the new folder
FileSystem:DeleteDir(path)