Commit ce88f7a3 authored by Kevin Atkinson's avatar Kevin Atkinson

Bug fixes and Tweaks.

Note: Readdirnames does not return entries for "." or ".." but it a
good idea to skip dirs/files starting with '.' anyway.
parent 27279083
......@@ -325,15 +325,22 @@ func (fs *Datastore) walkTopLevel(path string, reschan chan query.Result) error
if err != nil {
return err
}
defer dir.Close()
names, err := dir.Readdirnames(-1)
if err != nil {
return err
}
for _, dir := range names {
if len(dir) == 0 || dir[0] == '.' {
continue
}
err = fs.walk(filepath.Join(path, dir), reschan)
if err != nil {
return err
}
}
return nil
}
......@@ -343,6 +350,7 @@ func (fs *Datastore) walk(path string, reschan chan query.Result) error {
if err != nil {
return err
}
defer dir.Close()
names, err := dir.Readdirnames(-1)
if err != nil {
return err
......
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