mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
See according issue:
Details:
<https://github.com/nim-lang/Nim/issues/23442#issuecomment-2021763669>
---------
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
(cherry picked from commit 6cc783f7f3)
This commit is contained in:
@@ -754,14 +754,14 @@ template rawToFormalFileInfo(rawInfo, path, formalInfo): untyped =
|
||||
## 'rawInfo' is either a 'BY_HANDLE_FILE_INFORMATION' structure on Windows,
|
||||
## or a 'Stat' structure on posix
|
||||
when defined(windows):
|
||||
template merge(a, b): untyped =
|
||||
int64(
|
||||
template merge[T](a, b): untyped =
|
||||
cast[T](
|
||||
(uint64(cast[uint32](a))) or
|
||||
(uint64(cast[uint32](b)) shl 32)
|
||||
)
|
||||
formalInfo.id.device = rawInfo.dwVolumeSerialNumber
|
||||
formalInfo.id.file = merge(rawInfo.nFileIndexLow, rawInfo.nFileIndexHigh)
|
||||
formalInfo.size = merge(rawInfo.nFileSizeLow, rawInfo.nFileSizeHigh)
|
||||
formalInfo.id.file = merge[FileId](rawInfo.nFileIndexLow, rawInfo.nFileIndexHigh)
|
||||
formalInfo.size = merge[BiggestInt](rawInfo.nFileSizeLow, rawInfo.nFileSizeHigh)
|
||||
formalInfo.linkCount = rawInfo.nNumberOfLinks
|
||||
formalInfo.lastAccessTime = fromWinTime(rdFileTime(rawInfo.ftLastAccessTime))
|
||||
formalInfo.lastWriteTime = fromWinTime(rdFileTime(rawInfo.ftLastWriteTime))
|
||||
|
||||
Reference in New Issue
Block a user