From 355db0bc2924a6c9a7a771defe673ad312e2afa1 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 5 May 2019 12:45:56 +0200 Subject: [PATCH] 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. --- internal/restic/node_windows.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/restic/node_windows.go b/internal/restic/node_windows.go index aa0dee4b2..28ebff6ae 100644 --- a/internal/restic/node_windows.go +++ b/internal/restic/node_windows.go @@ -76,5 +76,6 @@ func (s statWin) mtim() 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()) }