summaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/local.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-03-31 13:47:06 +0200
committerRobin Appelman <icewind@owncloud.com>2015-03-31 13:50:11 +0200
commit068c624b0df7b82ea343136a5d471b538f0a5b44 (patch)
treea1001f3cf62e18580ff1460bbb72e668226fd400 /lib/private/files/storage/local.php
parent1d06d93d271210793baf575414ff0dd8f576dae0 (diff)
downloadnextcloud-server-068c624b0df7b82ea343136a5d471b538f0a5b44.tar.gz
nextcloud-server-068c624b0df7b82ea343136a5d471b538f0a5b44.zip
fix copying folder across devices
Diffstat (limited to 'lib/private/files/storage/local.php')
-rw-r--r--lib/private/files/storage/local.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php
index cf82e218969..6bd9b4401d6 100644
--- a/lib/private/files/storage/local.php
+++ b/lib/private/files/storage/local.php
@@ -228,6 +228,19 @@ if (\OC_Util::runningOnWindows()) {
$this->unlink($path2);
}
+ if ($this->is_dir($path1)) {
+ // we cant move folders across devices, use copy instead
+ $stat1 = stat(dirname($this->getSourcePath($path1)));
+ $stat2 = stat(dirname($this->getSourcePath($path2)));
+ if ($stat1['dev'] !== $stat2['dev']) {
+ $result = $this->copy($path1, $path2);
+ if ($result) {
+ $result &= $this->rmdir($path1);
+ }
+ return $result;
+ }
+ }
+
return rename($this->getSourcePath($path1), $this->getSourcePath($path2));
}