summaryrefslogtreecommitdiffstats
path: root/lib/files
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-06-19 02:42:18 -0700
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-06-19 02:42:18 -0700
commit904227a0e4b95be4f1a0aa87b9173fd2fea966c8 (patch)
tree632dcffaed9039b38e6a8c1093eea99b64ccde3a /lib/files
parentdd231b530d6cbf168c85bb83b2a268b1d70b8ce8 (diff)
parent87521f6c6e19bb2cff21ad0792604d24a6d6403e (diff)
downloadnextcloud-server-904227a0e4b95be4f1a0aa87b9173fd2fea966c8.tar.gz
nextcloud-server-904227a0e4b95be4f1a0aa87b9173fd2fea966c8.zip
Merge pull request #3661 from owncloud/fixing-windows-server-master
Fixing windows server master
Diffstat (limited to 'lib/files')
-rw-r--r--lib/files/cache/updater.php5
-rw-r--r--lib/files/view.php6
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/files/cache/updater.php b/lib/files/cache/updater.php
index 417a47f3830..87c33a313a4 100644
--- a/lib/files/cache/updater.php
+++ b/lib/files/cache/updater.php
@@ -7,6 +7,7 @@
*/
namespace OC\Files\Cache;
+use OCP\Util;
/**
* listen to filesystem hooks and change the cache accordingly
@@ -102,7 +103,7 @@ class Updater {
static public function correctFolder($path, $time) {
if ($path !== '' && $path !== '/') {
$parent = dirname($path);
- if ($parent === '.') {
+ if ($parent === '.' || $parent === '\\') {
$parent = '';
}
/**
@@ -116,6 +117,8 @@ class Updater {
if ($id !== -1) {
$cache->update($id, array('mtime' => $time, 'etag' => $storage->getETag($internalPath)));
self::correctFolder($parent, $time);
+ } else {
+ Util::writeLog('core', 'Path not in cache: '.$internalPath, Util::ERROR);
}
}
}
diff --git a/lib/files/view.php b/lib/files/view.php
index e2fc8d965b8..25071709fbe 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -386,6 +386,12 @@ class View {
$source = $this->fopen($path1 . $postFix1, 'r');
$target = $this->fopen($path2 . $postFix2, 'w');
list($count, $result) = \OC_Helper::streamCopy($source, $target);
+
+ // close open handle - especially $source is necessary because unlink below will
+ // throw an exception on windows because the file is locked
+ fclose($source);
+ fclose($target);
+
if ($result !== false) {
list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1);
$storage1->unlink($internalPath1);