| Crates.io | empty_inside_dir |
| lib.rs | empty_inside_dir |
| version | 1.1.0 |
| created_at | 2025-10-12 07:53:06.83961+00 |
| updated_at | 2025-10-12 08:56:39.835823+00 |
| description | Empty the contents of a directory without deleting itself. |
| homepage | |
| repository | https://github.com/aprosail/empty_inside_dir |
| max_upload_size | |
| id | 1879028 |
| size | 23,606 |
Empty the contents of a directory without deleting the directory itself. This is a simple and lightweight library with minimal functions.
The parameter's signature is impl AsRef<Path>,
which means it can accept any type that implements AsRef<Path>,
such as &Path, PathBuf, String, &str, etc.
use empty_inside_dir::empty_dir;
use std::path::Path;
fn main() -> Result<(), std::io::Error> {
...
empty_dir("xxx")?;
Ok(())
}
Ok(()) for non-existent paths.This crate is released under the Apache 2.0 License.