Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Change directory

  • set_current_dir
  • chdir
  • cd
use std::env;

fn main() {
    let folder = env::current_dir().unwrap();
    println!("{:?}", folder);

    env::set_current_dir("/tmp").unwrap();

    let folder = env::current_dir().unwrap();
    println!("{:?}", folder);
}