mirror of
https://github.com/restic/restic.git
synced 2025-08-12 11:37:40 +00:00
Examine file ctime when checking if files have changed.
This commit is contained in:
@@ -22,6 +22,7 @@ type ExtendedFileInfo struct {
|
||||
|
||||
AccessTime time.Time // last access time stamp
|
||||
ModTime time.Time // last (content) modification time stamp
|
||||
ChangeTime time.Time // last status change time stamp
|
||||
}
|
||||
|
||||
// ExtendedStat returns an ExtendedFileInfo constructed from the os.FileInfo.
|
||||
|
@@ -30,6 +30,7 @@ func extendedStat(fi os.FileInfo) ExtendedFileInfo {
|
||||
|
||||
AccessTime: time.Unix(s.Atimespec.Unix()),
|
||||
ModTime: time.Unix(s.Mtimespec.Unix()),
|
||||
ChangeTime: time.Unix(s.Ctimespec.Unix()),
|
||||
}
|
||||
|
||||
return extFI
|
||||
|
@@ -30,6 +30,7 @@ func extendedStat(fi os.FileInfo) ExtendedFileInfo {
|
||||
|
||||
AccessTime: time.Unix(s.Atim.Unix()),
|
||||
ModTime: time.Unix(s.Mtim.Unix()),
|
||||
ChangeTime: time.Unix(s.Ctim.Unix()),
|
||||
}
|
||||
|
||||
return extFI
|
||||
|
@@ -27,5 +27,7 @@ func extendedStat(fi os.FileInfo) ExtendedFileInfo {
|
||||
mtime := syscall.NsecToTimespec(s.LastWriteTime.Nanoseconds())
|
||||
extFI.ModTime = time.Unix(mtime.Unix())
|
||||
|
||||
extFI.ChangeTime = extFI.ModTime
|
||||
|
||||
return extFI
|
||||
}
|
||||
|
Reference in New Issue
Block a user