Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Forked from brson/gist:4013692
Created November 4, 2012 20:44
Show Gist options
  • Save mitsuhiko/4013696 to your computer and use it in GitHub Desktop.
Save mitsuhiko/4013696 to your computer and use it in GitHub Desktop.
fn main() {
match os::homedir() {
None => {
io::println("You have no home folder :-(");
}
Some(ref homedir) => {
io::println("Files in your home folder:");
for os::list_dir_path(homedir).each |path| {
match path.filename() {
Some(ref filename) => io::println(*filename),
_ => {}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment