1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-16 00:00:05 +01:00

changed stat

This commit is contained in:
jgfrm 2017-02-06 18:13:43 +01:00
parent ce90a281fd
commit 99a3e19661
3 changed files with 14 additions and 12 deletions

View file

@ -35,21 +35,10 @@ func walkDir(dir string) <-chan *dirEntry {
return nil
}
links := 1
if runtime.GOOS != "windows" {
stat, ok := restic.ToStatT(info.Sys())
if !ok {
return nil
}
links = stat.nlink()
}
ch <- &dirEntry{
path: name,
fi: info,
link: links,
link: nlink(),
}
return nil

View file

@ -6,6 +6,7 @@ import (
"fmt"
"os"
"syscall"
"restic"
)
func (e *dirEntry) equals(other *dirEntry) bool {
@ -44,3 +45,11 @@ func (e *dirEntry) equals(other *dirEntry) bool {
return true
}
func nlink(info os.FileInfo) (uint64, error) {
stat, err := restic.ToStatT(info.Sys())
if err {
return nil, ok
}
return stat.nlink(info), err
}

View file

@ -25,3 +25,7 @@ func (e *dirEntry) equals(other *dirEntry) bool {
return true
}
func nlink(info os.FileInfo) (uint64, error) {
return 1, err
}