Function std::os::getcwdExperimental [-]  [+] [src]

pub fn getcwd() -> IoResult<Path>

Returns the current working directory as a Path.

Errors

Returns an Err if the current working directory value is invalid. Possible cases:

Example

fn main() { use std::os; // We assume that we are in a valid directory. let current_working_directory = os::getcwd().unwrap(); println!("The current directory is {}", current_working_directory.display()); }
use std::os;

// We assume that we are in a valid directory.
let current_working_directory = os::getcwd().unwrap();
println!("The current directory is {}", current_working_directory.display());