commit | bd4fe04ca9aabfea85e83fdc2408125ff924a741 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Sat Mar 30 01:14:23 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Sat Mar 30 01:14:23 2024 +0000 |
tree | ed625d58145dc3ca6b41f74bc6b7f9e6561a9b78 | |
parent | cb3bc26de85e1953e6d02c509fd78c2df5d2effb [diff] | |
parent | 0491be1e8c55db0283defe6f653d48e0cd4dbbf6 [diff] |
Snap for 11648291 from 0491be1e8c55db0283defe6f653d48e0cd4dbbf6 to 24Q3-release Change-Id: I0a60bb7088308668524923c8b809d38ae0d2461a
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.