How to find the current working directory in Rust

1 Answer

0 votes
use std::env;

fn main() {
    let dir = env::current_dir().unwrap();

    println!("{:?}", dir);
}


/*
run:

"/playground"

*/

 



answered Jun 3, 2025 by avibootz

Related questions

1 answer 280 views
1 answer 263 views
2 answers 283 views
1 answer 412 views
2 answers 353 views
1 answer 404 views
...