Skip to content

Commit

Permalink
[Filesystem] Improve exception message for copy method
Browse files Browse the repository at this point in the history
  • Loading branch information
King2500 authored and fabpot committed Feb 16, 2015
1 parent 177e0a8 commit cb5db1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Filesystem.php
Expand Up @@ -72,8 +72,8 @@ public function copy($originFile, $targetFile, $override = false)
// Like `cp`, preserve executable permission bits
@chmod($targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111));

if (stream_is_local($originFile) && $bytesCopied !== filesize($originFile)) {
throw new IOException(sprintf('Failed to copy the whole content of "%s" to "%s %g bytes copied".', $originFile, $targetFile, $bytesCopied), 0, null, $originFile);
if (stream_is_local($originFile) && $bytesCopied !== ($bytesOrigin = filesize($originFile))) {
throw new IOException(sprintf('Failed to copy the whole content of "%s" to "%s" (%g of %g bytes copied).', $originFile, $targetFile, $bytesCopied, $bytesOrigin), 0, null, $originFile);
}
}
}
Expand Down

0 comments on commit cb5db1c

Please sign in to comment.