Skip to content

Instantly share code, notes, and snippets.

@killerswan
Created May 26, 2012 21:19
Show Gist options
  • Save killerswan/2795348 to your computer and use it in GitHub Desktop.
Save killerswan/2795348 to your computer and use it in GitHub Desktop.
os::copy_file makes a funny smell?
fn copy_warn(src: str, dest: str) {
if !os::copy_file(src, dest) {
io::println(#fmt["Copying %s to %s failed", src, dest]);
}
}
fn main() {
// EDIT: not so bad, I just wasn't paying attention
copy_warn("./dir/a", "./dir2" );
copy_warn("./dir/a", "./dir2/a"); // THIS ONE IS OK
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment