diff --git a/CHANGELOG.md b/CHANGELOG.md index be5aa0b..4265895 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Flagging a stream as blocking was set as non-blocking - Timeout periods above the minute were not taking into account - Socket client options are applied when connecting, not after +- Broken links couldn't be removed ## 4.1.2 - 2026-08-01 diff --git a/src/Internal/Capabilities/Files/AmbientAuthority.php b/src/Internal/Capabilities/Files/AmbientAuthority.php index 6824a94..dfce833 100644 --- a/src/Internal/Capabilities/Files/AmbientAuthority.php +++ b/src/Internal/Capabilities/Files/AmbientAuthority.php @@ -148,14 +148,14 @@ public function create(Path $path): Attempt #[\Override] public function remove(Path $path): Attempt { - if (!\file_exists($path->toString())) { - return Attempt::result(SideEffect::identity); - } - if (\is_link($path->toString())) { return $this->unlink($path->toString()); } + if (!\file_exists($path->toString())) { + return Attempt::result(SideEffect::identity); + } + if ($path->directory() && \is_dir($path->toString())) { return $this->rmdir($path->toString()); }