baml.fs.remove_dir_all

Recursively removes the directory at `path` and all of its contents. Idempotent: returns successfully if `path` does not exist. Like Bun's `fs.promises.rm(path, { recursive: true, force: true })` for directory trees and missing paths — but, unlike `rm -rf`, it targets directories only and throws `Io` if `path` is a regular file.

Reference version

Signature

function baml.fs.remove_dir_all(path: string) -> null throws baml.errors.Io

Recursively removes the directory at path and all of its contents. Idempotent: returns successfully if path does not exist. Like Bun's fs.promises.rm(path, { recursive: true, force: true }) for directory trees and missing paths — but, unlike rm -rf, it targets directories only and throws Io if path is a regular file.

Source:<builtin>/baml/ns_fs/fs.bamlbytes 6472–6565