15 releases

0.6.2 May 4, 2022
0.6.1 Jan 10, 2021
0.6.0 Feb 12, 2020
0.5.0 Oct 27, 2019
0.2.2 Nov 27, 2018

#441 in Filesystem

Download history 946/week @ 2024-03-24 830/week @ 2024-03-31 465/week @ 2024-04-07 1057/week @ 2024-04-14 643/week @ 2024-04-21 677/week @ 2024-04-28 883/week @ 2024-05-05 640/week @ 2024-05-12 387/week @ 2024-05-19 463/week @ 2024-05-26 530/week @ 2024-06-02 546/week @ 2024-06-09 534/week @ 2024-06-16 956/week @ 2024-06-23 785/week @ 2024-06-30 572/week @ 2024-07-07

2,913 downloads per month
Used in 16 crates (14 directly)

MIT OR Apache-2.0 OR CC0-1.0

11KB
242 lines

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").

Dependencies

~100–490KB