[Filesystem] Improve exception message for copy method
This commit is contained in:
parent
4c767e64b2
commit
021206c0ac
@ -72,8 +72,8 @@ class Filesystem
|
|||||||
// Like `cp`, preserve executable permission bits
|
// Like `cp`, preserve executable permission bits
|
||||||
@chmod($targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111));
|
@chmod($targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111));
|
||||||
|
|
||||||
if (stream_is_local($originFile) && $bytesCopied !== filesize($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 bytes copied".', $originFile, $targetFile, $bytesCopied), 0, null, $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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user