Skip to content

Commit

Permalink
Merge pull request #41 from juicedata/fix/readdir-unionfs
Browse files Browse the repository at this point in the history
unionfs: fix readdir
  • Loading branch information
jiefenghuang authored Dec 17, 2024
2 parents de4c36a + f125aa1 commit 799ccdf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions newunionfs/unionfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"io/ioutil"
"log"
"path/filepath"
"sort"
"syscall"

"github.com/hanwen/go-fuse/v2/fs"
Expand Down Expand Up @@ -369,6 +370,9 @@ func (n *unionFSNode) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)
result = append(result[maxIdx:], result[:maxIdx]...)
}

sort.Slice(result, func(i, j int) bool {
return result[i].Name < result[j].Name
})
return fs.NewListDirStream(result), 0
}

Expand Down

0 comments on commit 799ccdf

Please sign in to comment.