mirror of
https://github.com/restic/restic.git
synced 2025-03-09 00:00:02 +01:00
SkipDirs with errors
This commit is contained in:
parent
ff473dbab6
commit
2189d8fbce
1 changed files with 8 additions and 1 deletions
|
@ -685,7 +685,7 @@ func Scan(dirs []string, filter pipe.SelectFunc, p *Progress) (Stat, error) {
|
|||
// TODO: integrate error reporting
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error for %v: %v\n", str, err)
|
||||
return nil
|
||||
return filepath.SkipDir
|
||||
}
|
||||
if fi == nil {
|
||||
fmt.Fprintf(os.Stderr, "error for %v: FileInfo is nil\n", str)
|
||||
|
@ -702,6 +702,13 @@ func Scan(dirs []string, filter pipe.SelectFunc, p *Progress) (Stat, error) {
|
|||
|
||||
s := Stat{}
|
||||
if fi.IsDir() {
|
||||
_, err2 := os.Stat(str)
|
||||
if err2 != nil {
|
||||
debug.Log("Scan.Walk", "%v, err: %v", str, err2)
|
||||
fmt.Fprintf(os.Stderr, "error for %v: %v\n", str, err2)
|
||||
return filepath.SkipDir
|
||||
}
|
||||
|
||||
s.Dirs++
|
||||
} else {
|
||||
s.Files++
|
||||
|
|
Loading…
Add table
Reference in a new issue