:sig
function dir_remove(path : string, recursive : bool = false) bool

:params
path : the directory path to remove
recursive : `true` removes the directory and its contents

:returns
`true` on success.

:content
`dir_remove()` removes a directory.

Without `recursive`, the directory must be empty. With `recursive = true`, it removes every contained file and directory.

:example capy render
var root := file_temp("/tmp/capy-doc-dir-remove-")
file_unlink(root)
mkdir(root)
file_put_contents(path_join(root, "child.txt"), "x")
print(dir_remove(root, true), "\n")

:see-group
directories

:see
file_unlink
