Skip to content

Rmdir()

ts
Rmdir(path: string): respBase;

Deletes (removes) a directory from the target file-system's hierarchy.

IMPORTANT

Rmdir() will only remove the "leaf" (last) directory in the specified branch, not the entire branch. For example, if path is /data/backup/old, only the old directory will be removed.

WARNING

The directory to be removed must be empty, or the operation will fail.

Parameters

ParameterTypeExplanation
pathstringThe fully qualified root-based path to the directory you wish to delete

Returns a respBase object.

Example

ts
var vfs = GetCurrentVFS();
if (vfs != null) {
    var resp = vfs.Rmdir("/data/backup/old");
    if (resp.Ok()) {
        Log("Directory 'old' was deleted");
    } else {
        Log("Error: " + resp.ErrorMsg());
    }
} else {
    Log("VFS was null");
}