RemoveAll (recursive remove)
ts
function RemoveAll(path: string): respBase;Recursively deletes the file or directory specified by path and all of its contents from the VFS. Returns a respBase object indicating success or failure.
| Parameter | Type | Requirement | Explanation |
|---|---|---|---|
path | string | required | Path to a file or directory to remove (all contents will be deleted recursively) |
| Return type | Description |
|---|---|
respBase | Indicates success or failure; use Ok() and ErrorMsg() to check the result |
WARNING
This operation is irreversible. All files and subdirectories under the specified path will be permanently deleted.
Example
ts
var result = vfs.RemoveAll('/data/oldproject');
if (result.Ok()) {
Log('Directory and all contents removed successfully.');
} else {
Log('RemoveAll failed: ' + result.ErrorMsg());
}