Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-02-10 15:44:27 +0400
committerVincent Petry <pvince81@owncloud.com>2013-11-21 18:55:24 +0400
commit64b484e32e2d16736a8bacc86980026deefcf42a (patch)
tree11329d3573d88ec6b6fe34be4cf90baae6a8b9fa /lib
parentee581f56ea091b99d0640821de3e4ae207bc2d74 (diff)
Emulate touch() for backends that don't support it
Backport of 9738fae3cf1ad18593d21eb62e138e00c01f5f36
Diffstat (limited to 'lib')
-rw-r--r--lib/files/view.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/files/view.php b/lib/files/view.php
index f02e3d4d513..65c5a527a1b 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -254,7 +254,11 @@ class View {
$hooks[] = 'write';
}
- return $this->basicOperation('touch', $path, $hooks, $mtime);
+ $result = $this->basicOperation('touch', $path, array('write'), $mtime);
+ if (!$result) { //if native touch fails, we emulate it by changing the mtime in the cache
+ $this->putFileInfo($path, array('mtime' => $mtime));
+ }
+ return true;
}
public function file_get_contents($path) {