Open
Description
Is there a way with this library to first invoke the callback on all direct files under the current folder before recursing into the sub-folders?
Example:
package main
import (
"fmt"
"github.com/karrick/godirwalk"
)
func main() {
godirwalk.Walk("/tmp/test", &godirwalk.Options{
Callback: func(osPathname string, directoryEntry *godirwalk.Dirent) error {
fmt.Printf("%s\n", osPathname)
return nil
}})
}
currently results in:
/tmp/test
/tmp/test/afile
/tmp/test/dir1
/tmp/test/dir1/file2
/tmp/test/file
and the ask is to return:
/tmp/test
/tmp/test/afile
/tmp/test/file
/tmp/test/dir1
/tmp/test/dir1/file2
This way the results are still deterministic as all files of current folder are sorted, and the sub-folders are recursed into also in a sorted order.
Thanks!
Metadata
Assignees
Labels
No labels
Activity