Current working directory
Recipe | Crates | Categories |
---|---|---|
Get the current working directory |
Get the current working directory
use std::env; use anyhow::Result; fn main() -> Result<()> { let cwd = env::current_dir()?; println!("The current directory is {}", cwd.display()); Ok(()) }
[cwd: move to proper location (P1)](https://github.com/john-cd/rust_howto/issues/357)