commit | 3d84d668f8a669cf7edafc15c740cef21f0883ed | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Tue Sep 10 23:12:25 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Tue Sep 10 23:12:25 2024 +0000 |
tree | d15fd41349e4bfaf97a54e54aac9abdfaf1a76f1 | |
parent | 2f259bf221c82f9362256500b3051d44c48aa377 [diff] | |
parent | 776e78f00a9227423bb5b99f8790c3403c65bc91 [diff] |
Snap for 12349386 from 776e78f00a9227423bb5b99f8790c3403c65bc91 to sdk-release Change-Id: Icd5609d7cfc437157d5fa0d2012ff6434b57e5b6
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.