fix copying folder across devices

This commit is contained in:
Robin Appelman 2015-03-31 13:47:06 +02:00
parent 1d06d93d27
commit 068c624b0d
1 changed files with 13 additions and 0 deletions

View File

@ -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));
}