Current working directory

RecipeCratesCategories
Get the current working directorycat-filesystem

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(())
}