From d5e858bd9a580c834fe70cddeddaa0b76ad61395 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Tue, 16 Jun 2020 23:37:03 -0500 Subject: Fix Windows file date --- nimterop/build.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nimterop/build.nim b/nimterop/build.nim index 28f2b3c..dbdcd4c 100644 --- a/nimterop/build.nim +++ b/nimterop/build.nim @@ -244,7 +244,9 @@ proc getFileDate*(fullpath: string): string = ret = 0 cmd = when defined(Windows): - &"cmd /c for %a in ({fullpath.sanitizePath}) do echo %~ta" + let + (head, tail) = fullpath.splitPath() + &"cmd /c forfiles /P {head.sanitizePath()} /M {tail.sanitizePath} /C \"cmd /c echo @fdate @ftime @fsize\"" elif defined(Linux): &"stat -c %y {fullpath.sanitizePath}" elif defined(OSX) or defined(FreeBSD): -- cgit v1.2.3