diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index d9639e9f1abf9..49e5b39ebb6d1 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -185,6 +185,9 @@ public function newFile($path, $content = null) { $this->sendHooks(['preWrite', 'preCreate'], [$nonExisting]); if ($content !== null) { $result = $this->view->file_put_contents($fullPath, $content); + if ($content === '' && $result === 0) { + $result = true; + } } else { $result = $this->view->touch($fullPath); }