fix: match CHFS preview and listing behavior
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
@@ -258,7 +259,12 @@ func (s Local) List(path string) ([]os.FileInfo, error) {
|
||||
return nil, e
|
||||
}
|
||||
defer f.Close()
|
||||
return f.Readdir(-1)
|
||||
items, err := f.Readdir(-1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sort.Slice(items, func(i, j int) bool { return items[i].Name() < items[j].Name() })
|
||||
return items, nil
|
||||
}
|
||||
|
||||
var _ fs.FS
|
||||
|
||||
Reference in New Issue
Block a user