commit | 8faa524fd3a4133ed5cdf6790396defcaefadbef | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Tue Apr 02 23:11:47 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Tue Apr 02 23:11:47 2024 +0000 |
tree | ed625d58145dc3ca6b41f74bc6b7f9e6561a9b78 | |
parent | 290df081e1ddca0eaf955727418cb7d3bb980cc7 [diff] | |
parent | 5a52dc73c6f2a699b78e21ea0c77bec184131e6d [diff] |
Snap for 11662267 from 5a52dc73c6f2a699b78e21ea0c77bec184131e6d to sdk-release Change-Id: I5bae0285a2af32d2e006a129e4fc4d8c2cd65a49
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.