|
|
|
|
@ -372,11 +372,18 @@ class View { |
|
|
|
|
$result = false; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$source = $this->fopen($path1 . $postFix1, 'r'); |
|
|
|
|
$target = $this->fopen($path2 . $postFix2, 'w'); |
|
|
|
|
list($count, $result) = \OC_Helper::streamCopy($source, $target); |
|
|
|
|
list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); |
|
|
|
|
$storage1->unlink($internalPath1); |
|
|
|
|
if ($this->is_dir($path1)) { |
|
|
|
|
$result = $this->copy($path1, $path2); |
|
|
|
|
if ($result === true) { |
|
|
|
|
$result = $this->deleteAll($path1); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$source = $this->fopen($path1 . $postFix1, 'r'); |
|
|
|
|
$target = $this->fopen($path2 . $postFix2, 'w'); |
|
|
|
|
list($count, $result) = \OC_Helper::streamCopy($source, $target); |
|
|
|
|
list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); |
|
|
|
|
$storage1->unlink($internalPath1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path1)) { |
|
|
|
|
\OC_Hook::emit( |
|
|
|
|
@ -459,9 +466,18 @@ class View { |
|
|
|
|
$result = false; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$source = $this->fopen($path1 . $postFix1, 'r'); |
|
|
|
|
$target = $this->fopen($path2 . $postFix2, 'w'); |
|
|
|
|
list($count, $result) = \OC_Helper::streamCopy($source, $target); |
|
|
|
|
if ($this->is_dir($path1) && ($dh = $this->opendir($path1))) { |
|
|
|
|
$this->mkdir($path2); |
|
|
|
|
while ($file = readdir($dh)) { |
|
|
|
|
if (!Filesystem::isIgnoredDir($file)) { |
|
|
|
|
$result = $this->copy($path1 . '/' . $file, $path2 . '/' . $file); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$source = $this->fopen($path1 . $postFix1, 'r'); |
|
|
|
|
$target = $this->fopen($path2 . $postFix2, 'w'); |
|
|
|
|
list($count, $result) = \OC_Helper::streamCopy($source, $target); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ($this->fakeRoot == Filesystem::getRoot()) { |
|
|
|
|
\OC_Hook::emit( |
|
|
|
|
|