#filesystem #rm #remove

rm_rf

Force-remove a file/directory and all descendants

13 releases (5 breaking)

✓ Uses Rust 2018 edition

new 0.6.0 Feb 12, 2020
0.5.0 Oct 27, 2019
0.2.4 Apr 5, 2019
0.2.3 Mar 25, 2019
0.2.2 Nov 27, 2018

#64 in Filesystem

Download history 144/week @ 2019-11-01 93/week @ 2019-11-08 126/week @ 2019-11-15 155/week @ 2019-11-22 121/week @ 2019-11-29 106/week @ 2019-12-06 364/week @ 2019-12-13 68/week @ 2019-12-20 70/week @ 2019-12-27 67/week @ 2020-01-03 76/week @ 2020-01-10 85/week @ 2020-01-17 119/week @ 2020-01-24 138/week @ 2020-01-31 130/week @ 2020-02-07

533 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

~90–255KB