fix using touch to create a file for smb

This commit is contained in:
Robin Appelman 2013-10-01 22:31:22 +02:00
parent ea566868a8
commit 29deef38b2
1 changed files with 15 additions and 11 deletions

View File

@ -56,6 +56,7 @@ abstract class StreamWrapper extends Common{
}
public function touch($path, $mtime = null) {
if ($this->file_exists($path)) {
if (is_null($mtime)) {
$fh = $this->fopen($path, 'a');
fwrite($fh, '');
@ -65,6 +66,9 @@ abstract class StreamWrapper extends Common{
} else {
return false; //not supported
}
} else {
$this->file_put_contents($path, '');
}
}
public function getFile($path, $target) {