rm_rf

Crates.iorm_rf
lib.rsrm_rf
version0.6.2
sourcesrc
created_at2018-11-11 19:35:14.601479
updated_at2022-05-04 22:36:10.413757
descriptionForce-remove a file/directory and all descendants
homepage
repositoryhttps://github.com/vn971/rm_rf
max_upload_size
id96108
size12,249
Vasili Novikov (vn971)

documentation

README

rm -rf CI crates.io

Force-remove a file/directory and all descendants.

In contrast to std::fs::remove_dir_all, it will remove empty directories that lack read access on Linux, and will remove "read-only" files and directories on Windows.

Usage

rm_rf::remove("target")?; // remove, fail if target doesn't exists (this is `rm -rf` behavior)
rm_rf::ensure_removed("target")?; // remove, but ignore if target doesn't exist

Note: to avoid stack overflow for deeply nested directories, this library uses stacker.

Other

Licensed as (at your choice): MIT, Apache2 and CC0 ("public domain").

Commit count: 37

cargo fmt