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

pub fn change_dir(p: &Path) -> IoResult<()>

Changes the current working directory to the specified path, returning whether the change was completed successfully or not.

Example

fn main() { use std::os; use std::path::Path; let root = Path::new("/"); assert!(os::change_dir(&root).is_ok()); println!("Successfully changed working directory to {}!", root.display()); }
use std::os;
use std::path::Path;

let root = Path::new("/");
assert!(os::change_dir(&root).is_ok());
println!("Successfully changed working directory to {}!", root.display());