Skip to content

Instantly share code, notes, and snippets.

@wbthomason
Created September 25, 2013 20:15
Show Gist options
  • Save wbthomason/6705396 to your computer and use it in GitHub Desktop.
Save wbthomason/6705396 to your computer and use it in GitHub Desktop.
A partial module for internal shell functions.
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