Skip to content

Commit 96a1251

Browse files
authored
Changed from fs.stat(p) to fs.unixFS.Lstat(p) (#141)
to fix deletion of symlinks
1 parent 7b55e6b commit 96a1251

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

server/filesystem/filesystem.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func (fs *Filesystem) Delete(p string) error {
406406
// it recursively deletes all non-denylisted files and subdirectories. Empty directories
407407
// are removed automatically, but directories containing denylisted files are preserved.
408408
func (fs *Filesystem) SafeDeleteRecursively(p string) error {
409-
info, err := fs.Stat(p)
409+
info, err := fs.unixFS.Lstat(p)
410410
if err != nil {
411411
return err
412412
}
@@ -436,7 +436,7 @@ func (fs *Filesystem) SafeDeleteRecursively(p string) error {
436436
return err
437437
}
438438
// Check if the directory still exists after recursive deletion
439-
if _, statErr := fs.Stat(child); statErr == nil {
439+
if _, statErr := fs.unixFS.Lstat(child); statErr == nil {
440440
hasRemainingFiles = true
441441
}
442442
continue

0 commit comments

Comments
 (0)