#filesystem #remove #rm

rm_rf

Force-remove file or directory

5 releases

0.2.2 Nov 27, 2018
0.2.1 Nov 24, 2018
0.2.0 Nov 23, 2018
0.1.1 Nov 11, 2018
0.1.0 Nov 11, 2018

#67 in Filesystem

Download history 31/week @ 2018-11-08 23/week @ 2018-11-15 77/week @ 2018-11-22 66/week @ 2018-11-29 19/week @ 2018-12-06 28/week @ 2018-12-13 34/week @ 2018-12-20 20/week @ 2018-12-27 50/week @ 2019-01-03 23/week @ 2019-01-10 27/week @ 2019-01-17

104 downloads per month
Used in 1 crate

MIT OR Apache-2.0 OR CC0-1.0

5KB
86 lines

TimePlot Build Status crates.io

rm -rf

Force-removes 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

Cargo.toml: add the latest crate version.

Rust:

extern crate rm_rf;

fn main() {
    // Failure may still happen, in situations identical to where `rm -rf` would fail.
    rm_rf::force_remove_all("target", true).expect("Failed to remove file/directory");
}

Other

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

Dependencies

~779KB