Permalink
Browse files

Don't try to copy directories in IO::copy. Previously it hanged, now …

…it gives a friendly die()
  • Loading branch information...
1 parent a357c9f commit 592e2989f02ee67e910adefc9f79c47dfadec599 @tadzik tadzik committed Mar 13, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/core/IO.pm
View
@@ -191,6 +191,9 @@ class IO is Cool {
}
multi method copy($dest as Str) {
+ if self.d() {
+ die "Cannot copy '$.path': Is a directory"
+ }
try {
pir::new__PS('File').copy($.path, $dest);
}

0 comments on commit 592e298

Please sign in to comment.