#remove #delete #file #directory #recursive

rm_rf

Force-remove a file/directory and all descendants

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

#5 in #recursive

Download history 419/week @ 2022-11-30 894/week @ 2022-12-07 625/week @ 2022-12-14 467/week @ 2022-12-21 384/week @ 2022-12-28 576/week @ 2023-01-04 552/week @ 2023-01-11 726/week @ 2023-01-18 655/week @ 2023-01-25 946/week @ 2023-02-01 1128/week @ 2023-02-08 969/week @ 2023-02-15 740/week @ 2023-02-22 414/week @ 2023-03-01 737/week @ 2023-03-08 429/week @ 2023-03-15

2,574 downloads per month
Used in 12 crates (11 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

~99–300KB