Conversation
|
This PR (HEAD: 5c27ec0) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/682816. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
5c27ec0 to
4bc759a
Compare
|
This PR (HEAD: 4bc759a) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/682816. Important tips:
|
|
Message from Gregor Matura: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Gregor Matura: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Gregor Matura: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Gregor Matura: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Gregor Matura: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Gregor Matura: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 5: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Gregor Matura: Patch Set 5: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 5: (6 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
933c73d to
8443a7e
Compare
|
This PR (HEAD: 8443a7e) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/682816. Important tips:
|
8443a7e to
933af5e
Compare
|
This PR (HEAD: 933af5e) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/682816. Important tips:
|
|
Message from Gregor Matura: Patch Set 8: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 8: Commit-Queue+1 (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
933af5e to
1748322
Compare
|
Message from Go LUCI: Patch Set 8: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-02-25T08:12:34Z","revision":"bed02f8dd686bf04ed1c40130fc648c751bfbbda"} Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 8: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_5070>) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Go LUCI: Patch Set 8: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Go LUCI: Patch Set 8: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
This PR (HEAD: 1748322) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/682816. Important tips:
|
|
Message from Gregor Matura: Patch Set 10: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 10: (8 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
1748322 to
8fb08ee
Compare
|
This PR (HEAD: 8fb08ee) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/682816. Important tips:
|
|
Message from Gregor Matura: Patch Set 10: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 11: Code-Review+2 Commit-Queue+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Go LUCI: Patch Set 11: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-02-26T23:53:49Z","revision":"50e14a6492566fe058a5d4fcef85d390e94839fe"} Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 11: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_5070>) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Go LUCI: Patch Set 11: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Go LUCI: Patch Set 11: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 11: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from David Chase: Patch Set 11: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Russ Cox: Patch Set 11: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Russ Cox: Patch Set 11: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
Message from Alex Brainman: Patch Set 11: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
Filetime.Nanoseconds() has a major drawback: the returned int64 is too small to represent Filetime's zero value (January 1, 1601) in terms of nanoseconds since Epoch (00:00:00 UTC, January 1, 1970); MinInt64 only dates back to year 1677. This has real-life implications, e.g., some Windows sub systems (Perflib, to name one) create registry keys with the last write time property set to zero. In this case, ModTime() reports an underflow-affected value of 2185-07-22T00:34:33.709551+01:00. This commit drops usage of Nanoseconds() in favor of a conversion that converts first to seconds and nanoseconds before gauging thus is capable to cover the full range of Filetime values. Fixes golang/go#74335
8fb08ee to
0073d1d
Compare
|
This PR (HEAD: 0073d1d) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/682816. Important tips:
|
|
Message from Gregor Matura: Patch Set 11: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
Filetime.Nanoseconds() has a major drawback: the returned int64 is too small to
represent Filetime's zero value (January 1, 1601, [1]) in terms of nanoseconds
since Epoch (00:00:00 UTC, January 1, 1970); MinInt64 [2] only dates back to
year 1677.
This has real-life implications, e.g., some Windows sub systems (Perflib, to
name one) create registry keys with the last write time property set to
zero (see note below). In this case, ModTime() reports an underflow-affected
value of 2185-07-22T00:34:33.709551+01:00.
This commit drops usage of Nanoseconds() in favor of a conversion that converts
first to seconds and nanoseconds before gauging thus is capable to cover the
full range of Filetime values.
A note on last write time values: `lastWriteTime` is not exposed in the UI
(say, `regedit`) or in PowerShell (`Get-ItemProperty`), you need to query
`RegQueryInfoKeyA` [3] explicitly in some way [4] or another [5]. The source of
the latter is offline by now but can be found elsewhere [6] and provides a
quick way to show the value.
[1] https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime
[2] https://pkg.go.dev/math#pkg-constants
[3] https://learn.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryinfokeya?redirectedfrom=MSDN
[4] https://learn.microsoft.com/en-us/windows/win32/sysinfo/retrieving-the-last-write-time
[5] https://learn-powershell.net/2014/12/18/retrieving-a-registry-key-lastwritetime-using-powershell/
[6] https://github.com/wxrdnx/GetRegistryKeyLastWriteTimeAndClassName
Fixes golang/go#74335.
Change-Id: I83dc1d6b5e0c581bfb53d58ee08a21ed9c166b0f
GitHub-Last-Rev: 0073d1d
GitHub-Pull-Request: #251
Reviewed-on: https://go-review.googlesource.com/c/sys/+/682816
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: David Chase <drchase@google.com>
|
Message from Alex Brainman: Patch Set 12: Code-Review+2 Commit-Queue+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/682816. |
|
This PR is being closed because golang.org/cl/682816 has been merged. |
Filetime.Nanoseconds() has a major drawback: the returned int64 is too small to
represent Filetime's zero value (January 1, 1601, [1]) in terms of nanoseconds
since Epoch (00:00:00 UTC, January 1, 1970); MinInt64 [2] only dates back to
year 1677.
This has real-life implications, e.g., some Windows sub systems (Perflib, to
name one) create registry keys with the last write time property set to
zero (see note below). In this case, ModTime() reports an underflow-affected
value of 2185-07-22T00:34:33.709551+01:00.
This commit drops usage of Nanoseconds() in favor of a conversion that converts
first to seconds and nanoseconds before gauging thus is capable to cover the
full range of Filetime values.
A note on last write time values:
lastWriteTimeis not exposed in the UI(say,
regedit) or in PowerShell (Get-ItemProperty), you need to queryRegQueryInfoKeyA[3] explicitly in some way [4] or another [5]. The source ofthe latter is offline by now but can be found elsewhere [6] and provides a
quick way to show the value.
[1] https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime
[2] https://pkg.go.dev/math#pkg-constants
[3] https://learn.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryinfokeya?redirectedfrom=MSDN
[4] https://learn.microsoft.com/en-us/windows/win32/sysinfo/retrieving-the-last-write-time
[5] https://learn-powershell.net/2014/12/18/retrieving-a-registry-key-lastwritetime-using-powershell/
[6] https://github.com/wxrdnx/GetRegistryKeyLastWriteTimeAndClassName
Fixes golang/go#74335.