Rust create directory if not exists example snippet:
use std::fs;
fn main() -> std::io::Result<()> {
fs::create_dir_all("/some/dir")?;
Ok(())
}
Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.