diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-02-10 12:44:27 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-21 15:55:24 +0100 |
commit | 64b484e32e2d16736a8bacc86980026deefcf42a (patch) | |
tree | 11329d3573d88ec6b6fe34be4cf90baae6a8b9fa /lib/files/view.php | |
parent | ee581f56ea091b99d0640821de3e4ae207bc2d74 (diff) | |
download | nextcloud-server-64b484e32e2d16736a8bacc86980026deefcf42a.tar.gz nextcloud-server-64b484e32e2d16736a8bacc86980026deefcf42a.zip |
Emulate touch() for backends that don't support it
Backport of 9738fae3cf1ad18593d21eb62e138e00c01f5f36
Diffstat (limited to 'lib/files/view.php')
-rw-r--r-- | lib/files/view.php | 6 |
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) { |