if the file doesn't exists; create a new one. We use this to create new text files in the web interface

This commit is contained in:
Björn Schießle 2013-07-12 13:25:37 +02:00
parent 01f3f8e0cc
commit da892d69ab
1 changed files with 7 additions and 1 deletions

View File

@ -234,7 +234,13 @@ class DAV extends \OC\Files\Storage\Common{
$mtime=time();
}
$path=$this->cleanPath($path);
$this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
// if file exists, update the mtime, else create a new empty file
if ($this->file_exists($path)) {
$this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
} else {
$this->file_put_contents($path, '');
}
}
public function getFile($path, $target) {