Current working directory

RecipeCratesCategories
Get the current working directorystdcat-filesystem

Get the current working directory

std cat-filesystem

use std::env;

use anyhow::Result;

fn main() -> Result<()> {
    let cwd = env::current_dir()?;
    println!("The current directory is {}", cwd.display());
    Ok(())
}