Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15444743
D21643.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
949 B
Referenced Files
None
Subscribers
None
D21643.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D21643: On Windows, implement "Filesystem::copyFile()" with "copy()"
Attached
Detach File
Event Timeline
Log In to Comment