commit | 4c7c0c3bfb2d0fedfe80008faf9928a37b2ae64f | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Fri Jun 17 03:16:14 2022 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Fri Jun 17 03:16:14 2022 +0000 |
tree | c780a30807e24adda54b518bf6434a04e1cab22c | |
parent | 1cbef4d9eda4e1be5a1250a991c7d3bbd93acfa1 [diff] | |
parent | 9ddf05b353e122747801c7ff04928563ec7b5a8e [diff] |
Snap for 8736785 from 9ddf05b353e122747801c7ff04928563ec7b5a8e to udc-release Change-Id: I679386a9c889f15d74b1d52253fafdfb9e4b5f44
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.