Created
September 25, 2013 20:15
-
-
Save wbthomason/6705396 to your computer and use it in GitHub Desktop.
A partial module for internal shell functions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{os, path, str}; | |
mod internal { | |
pub fn changedir(pathstr: &str) { | |
let path = Path(pathstr); | |
if os::path_exists(path) && os::path_is_dir(path) && os::change_dir(path){ | |
println(pathstr); | |
} | |
else { | |
println(fmt!("Error: %s is not a valid directory", pathstr)); | |
println(fmt!("Current working directory is: %s", str::str(os::getcwd()))); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment