diff options
Diffstat (limited to 'apps/files_external/lib/smb.php')
-rw-r--r-- | apps/files_external/lib/smb.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index fb6259930ba..0ca58f0daa7 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -72,12 +72,18 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ } /** - * Unlinks file + * Unlinks file or directory * @param string @path */ public function unlink($path) { - unlink($this->constructUrl($path)); - clearstatcache(); + if ($this->is_dir($path)) { + $this->rmdir($path); + } + else { + $url = $this->constructUrl($path); + unlink($url); + clearstatcache(false, $url); + } // smb4php still returns false even on success so // check here whether file was really deleted return !file_exists($path); |