Available since Version 1.0.
Deletes a directory at the specified path.
Syntax
Directory.Delete( path, [ recursive ] );Arguments
- path (string): The path of the directory to delete.
- recursive (boolean, optional): If true, deletes the directory and all its contents recursively. Defaults to false.
Return Values
- (boolean): Returns true if the directory was deleted successfully, or false if an error occurred (e.g., if the directory does not exist or if the path is invalid).
Examples
local success = Directory.Delete("new_directory")
if success then
print("Directory deleted successfully!")
else
print("Failed to delete directory.")
end