#remove #delete #file #directory #recursive

rm_rf

Force-remove a file/directory and all descendants

14 releases

new 0.6.1 Jan 10, 2021
0.6.0 Feb 12, 2020
0.5.1 Jan 26, 2020
0.5.0 Oct 27, 2019
0.2.2 Nov 27, 2018

#78 in Filesystem

Download history 141/week @ 2020-09-25 167/week @ 2020-10-02 209/week @ 2020-10-09 109/week @ 2020-10-16 130/week @ 2020-10-23 102/week @ 2020-10-30 196/week @ 2020-11-06 106/week @ 2020-11-13 187/week @ 2020-11-20 176/week @ 2020-11-27 136/week @ 2020-12-04 104/week @ 2020-12-11 139/week @ 2020-12-18 111/week @ 2020-12-25 137/week @ 2021-01-01 222/week @ 2021-01-08

593 downloads per month
Used in 3 crates

MIT OR Apache-2.0 OR CC0-1.0

11KB
243 lines

rm -rf Build Status 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
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").

Dependencies

~98–280KB