Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@klutzy
Created November 13, 2013 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klutzy/7450792 to your computer and use it in GitHub Desktop.
Save klutzy/7450792 to your computer and use it in GitHub Desktop.
cur dir race
use std::os;
use std::io;
use std::io::fs;
fn main() {
let tmp_path = os::tmpdir();
for i in range(0u, 20u) {
let path = tmp_path.join(i.to_str());
do spawn {
io::result(|| fs::mkdir(&path, io::UserRWX));
let _ret = os::change_dir(&path);
let cur = os::getcwd();
if cur != path {
println!("expected {:s} but found {:s}",
path.as_str().unwrap(), cur.as_str().unwrap());
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment