commit | 9cf014ba9de16c09a868122f1f66cabaa7b8e581 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Wed Jan 25 02:42:59 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Wed Jan 25 02:42:59 2023 +0000 |
tree | 20db9117f637171487b44b42b1bc1f1473a7a36e | |
parent | 4c7c0c3bfb2d0fedfe80008faf9928a37b2ae64f [diff] | |
parent | dc314dd3b660a73f786f8a992f4adedb10555321 [diff] |
Snap for 9523845 from dc314dd3b660a73f786f8a992f4adedb10555321 to udc-release Change-Id: Ia4c024710f8511bbe7837fe304159c816e43907d
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(); }
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.