diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-02-10 12:44:27 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-02-10 12:44:27 +0100 |
commit | 9738fae3cf1ad18593d21eb62e138e00c01f5f36 (patch) | |
tree | d5a71f87ea49d758ac50696b7033ce605f61db0a /lib | |
parent | 3e70d563a6774567ec77e9d9adf6b9ccb1e9619d (diff) | |
download | nextcloud-server-9738fae3cf1ad18593d21eb62e138e00c01f5f36.tar.gz nextcloud-server-9738fae3cf1ad18593d21eb62e138e00c01f5f36.zip |
Emulate touch() for backends that don't support it
Diffstat (limited to 'lib')
-rw-r--r-- | lib/files/view.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/files/view.php b/lib/files/view.php index 1a234228eab..69e2f1ad349 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -242,7 +242,11 @@ class View { if (!is_null($mtime) and !is_numeric($mtime)) { $mtime = strtotime($mtime); } - return $this->basicOperation('touch', $path, array('write'), $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) { @@ -917,11 +921,11 @@ class View { } /** - * Get the owner for a file or folder - * - * @param string $path - * @return string - */ + * Get the owner for a file or folder + * + * @param string $path + * @return string + */ public function getOwner($path) { return $this->basicOperation('getOwner', $path); } |