Page MenuHomePhabricator

D21643.diff
No OneTemporary

D21643.diff

diff --git a/src/filesystem/Filesystem.php b/src/filesystem/Filesystem.php
--- a/src/filesystem/Filesystem.php
+++ b/src/filesystem/Filesystem.php
@@ -269,7 +269,29 @@
self::assertReadable($from);
if (phutil_is_windows()) {
- execx('copy /Y %s %s', $from, $to);
+ $trap = new PhutilErrorTrap();
+ $ok = @copy($from, $to);
+ $err = $trap->getErrorsAsString();
+ $trap->destroy();
+
+ if (!$ok) {
+ if (strlen($err)) {
+ throw new FilesystemException(
+ $to,
+ pht(
+ 'Failed to copy file from "%s" to "%s": %s',
+ $from,
+ $to,
+ $err));
+ } else {
+ throw new FilesystemException(
+ $to,
+ pht(
+ 'Failed to copy file from "%s" to "%s".',
+ $from,
+ $to));
+ }
+ }
} else {
execx('cp -p %s %s', $from, $to);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 28, 11:02 AM (2 w, 6 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7226225
Default Alt Text
D21643.diff (949 B)

Event Timeline