#filesystem #remove #rm

rm_rf

Force-remove file or directory

2 releases

0.1.1 Nov 11, 2018
0.1.0 Nov 11, 2018

#57 in #filesystem

Download history 42/week @ 2018-11-17 43/week @ 2018-11-24 77/week @ 2018-12-01 45/week @ 2018-12-08

3 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

~793KB