Commit 82f55060 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Provide diagnostic in case of missing stat from readdir.

parent a88546e5
...@@ -66,11 +66,14 @@ func (me *LoopbackFileSystem) OpenDir(name string, context *Context) (stream cha ...@@ -66,11 +66,14 @@ func (me *LoopbackFileSystem) OpenDir(name string, context *Context) (stream cha
for { for {
infos, err := f.Readdir(want) infos, err := f.Readdir(want)
for i := range infos { for i := range infos {
n := infos[i].Name()
d := DirEntry{ d := DirEntry{
Name: infos[i].Name(), Name: n,
} }
if s := ToStatT(infos[i]); s != nil { if s := ToStatT(infos[i]); s != nil {
d.Mode = s.Mode d.Mode = s.Mode
} else {
log.Println("ReadDir entry %q for %q has no stat info", n, name)
} }
output <- d output <- d
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment