Skip to content

removeAll ​

Recursively removes a directory and all of its contents. This is equivalent to rm(path, { recursive: true }) but does not accept options.

SignatureremoveAll(path: string): Result<void, FsError>

The operation returns Err(FsError) on failure; inspect it with match or propagate it with ?.

Example ​

tyrus
import { removeAll, type FsError } from "tyrus:fs";

match (removeAll("tempdir")) {
    Ok(_) => {}
    Err(error) => { printError(error.code); // ERR_FS_REMOVE_FAILED
    }
}