From a275497dc096e07d9fee3a515ba5c14f33dd8ebc Mon Sep 17 00:00:00 2001 From: Dennis Verspuij <6680484+dennisverspuij@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:53:38 +0200 Subject: [PATCH] Release directory iterator and thereby its potential directory lock prior to deleting a directory, to avoid e.g. "Text file busy" error with VirtualBox shared folder storage Signed-off-by: Dennis Verspuij <6680484+dennisverspuij@users.noreply.github.com> --- lib/private/Files/Storage/Local.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index ac3696118f7ee..a65d60bf278dd 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -117,6 +117,7 @@ public function rmdir($path) { } $it->next(); } + unset($it); // Release iterator and thereby its potential directory lock (e.g. in case of VirtualBox shared folders) clearstatcache(true, $this->getSourcePath($path)); return rmdir($this->getSourcePath($path)); } catch (\UnexpectedValueException $e) {