1# remove_dir_all 2 3[](https://crates.io/crates/remove_dir_all) 4[](https://docs.rs/remove_dir_all) 5[](https://github.com/XAMPPRocky/remove_dir_all) 6 7## Description 8 9Reliable and fast directory removal functions. 10 11* `remove_dir_all` - on non-Windows this is a re-export of 12 `std::fs::remove_dir_all`. For Windows an implementation that handles the 13 locking of directories that occurs when deleting directory trees rapidly. 14 15* `remove_dir_contents` - as for `remove_dir_all` but does not delete the 16 supplied root directory. 17 18* `ensure_empty_dir` - as for `remove_dir_contents` but will create the 19 directory if it does not exist. 20 21```rust,no_run 22extern crate remove_dir_all; 23 24use remove_dir_all::*; 25 26fn main() { 27 remove_dir_all("./temp/").unwrap(); 28 remove_dir_contents("./cache/").unwrap(); 29} 30``` 31 32## Minimum Rust Version 33The 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. 34