2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-29 16:23:59 +00:00

windows: Use LastWriteTime for ctime and mtime

Windows does not have a concept of a `change time` in the sense as Unix
has it: the field `CreationTime` of the `Win32FileAttributeData` struct
is not updated when attributes or content is changed. So from now on
we're using the `LastWriteTime` as the `change time` on Windows.
This commit is contained in:
Alexander Neumann 2019-05-05 12:45:56 +02:00
parent 6e2fe73189
commit 355db0bc29

View File

@ -76,5 +76,6 @@ func (s statWin) mtim() syscall.Timespec {
} }
func (s statWin) ctim() syscall.Timespec { func (s statWin) ctim() syscall.Timespec {
return syscall.NsecToTimespec(s.CreationTime.Nanoseconds()) // Windows does not have the concept of a "change time" in the sense Unix uses it, so we're using the LastWriteTime here.
return syscall.NsecToTimespec(s.LastWriteTime.Nanoseconds())
} }