summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-10-01 22:31:22 +0200
committerRobin Appelman <icewind@owncloud.com>2013-10-01 22:31:22 +0200
commit29deef38b27f2b33eec8925cab7f6f323a35ea96 (patch)
treef69daadb7fe027b1e63f8de686ea1cfe6465ff9d /apps
parentea566868a8c0ce7da49fceb29a9d22b46034d642 (diff)
downloadnextcloud-server-29deef38b27f2b33eec8925cab7f6f323a35ea96.tar.gz
nextcloud-server-29deef38b27f2b33eec8925cab7f6f323a35ea96.zip
fix using touch to create a file for smb
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/streamwrapper.php28
1 files changed, 16 insertions, 12 deletions
diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php
index beb4ec5605f..a110c006529 100644
--- a/apps/files_external/lib/streamwrapper.php
+++ b/apps/files_external/lib/streamwrapper.php
@@ -8,7 +8,7 @@
namespace OC\Files\Storage;
-abstract class StreamWrapper extends Common{
+abstract class StreamWrapper extends Common {
abstract public function constructUrl($path);
public function mkdir($path) {
@@ -16,7 +16,7 @@ abstract class StreamWrapper extends Common{
}
public function rmdir($path) {
- if($this->file_exists($path)) {
+ if ($this->file_exists($path)) {
$success = rmdir($this->constructUrl($path));
clearstatcache();
return $success;
@@ -34,11 +34,11 @@ abstract class StreamWrapper extends Common{
}
public function isReadable($path) {
- return true;//not properly supported
+ return true; //not properly supported
}
public function isUpdatable($path) {
- return true;//not properly supported
+ return true; //not properly supported
}
public function file_exists($path) {
@@ -55,15 +55,19 @@ abstract class StreamWrapper extends Common{
return fopen($this->constructUrl($path), $mode);
}
- public function touch($path, $mtime=null) {
- if(is_null($mtime)) {
- $fh = $this->fopen($path, 'a');
- fwrite($fh, '');
- fclose($fh);
-
- return true;
+ public function touch($path, $mtime = null) {
+ if ($this->file_exists($path)) {
+ if (is_null($mtime)) {
+ $fh = $this->fopen($path, 'a');
+ fwrite($fh, '');
+ fclose($fh);
+
+ return true;
+ } else {
+ return false; //not supported
+ }
} else {
- return false;//not supported
+ $this->file_put_contents($path, '');
}
}