#utility #filesystem #windows #remove-dir

remove_dir_all

A safe, reliable implementation of remove_dir_all for Windows

10 releases (5 breaking)

0.7.0 Mar 5, 2021
0.6.1 Oct 16, 2020
0.6.0 Aug 25, 2020
0.5.3 Jun 12, 2020
0.1.0 Mar 29, 2017

#23 in Filesystem

Download history 262260/week @ 2021-04-05 264621/week @ 2021-04-12 266168/week @ 2021-04-19 267962/week @ 2021-04-26 249220/week @ 2021-05-03 272517/week @ 2021-05-10 266275/week @ 2021-05-17 269123/week @ 2021-05-24 262893/week @ 2021-05-31 283932/week @ 2021-06-07 286025/week @ 2021-06-14 277680/week @ 2021-06-21 272077/week @ 2021-06-28 276053/week @ 2021-07-05 283209/week @ 2021-07-12 270939/week @ 2021-07-19

1,100,838 downloads per month
Used in 6,085 crates (35 directly)

MIT/Apache

13KB
204 lines

remove_dir_all

Latest Version Docs License

Description

Reliable and fast directory removal functions.

  • remove_dir_all - on non-Windows this is a re-export of std::fs::remove_dir_all. For Windows an implementation that handles the locking of directories that occurs when deleting directory trees rapidly.

  • remove_dir_contents - as for remove_dir_all but does not delete the supplied root directory.

  • ensure_empty_dir - as for remove_dir_contents but will create the directory if it does not exist.

extern crate remove_dir_all;

use remove_dir_all::*;

fn main() {
    remove_dir_all("./temp/").unwrap();
    remove_dir_contents("./cache/").unwrap();
}

Minimum Rust Version

The minimum rust version for remove_dir_all is the latest stable release, and the minimum version may be bumped through patch releases. You can pin to a specific version by setting by add = to your version (e.g. =0.6.0), or commiting a Cargo.lock file to your project.

Dependencies

~0–310KB