This commit is contained in:
John
2020-09-02 21:36:21 +08:00
parent 6dc4b81693
commit 3952d74f87

View File

@ -7,6 +7,7 @@
package gfile
import (
"fmt"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/text/gstr"
"os"
@ -104,6 +105,7 @@ func ScanDirFile(path string, pattern string, recursive ...bool) ([]string, erro
// the <path> and its sub-folders. It ignores the sub-file path if <handler> returns an empty
// string, or else it appends the sub-file path to result slice.
func doScanDir(depth int, path string, pattern string, recursive bool, handler func(path string) string) ([]string, error) {
fmt.Println("doScanDir:", path)
if depth >= gMAX_SCAN_DEPTH {
return nil, gerror.Newf("directory scanning exceeds max recursive depth: %d", gMAX_SCAN_DEPTH)
}