diff --git a/system-fileio/ChangeLog.md b/system-fileio/ChangeLog.md index 161d3ee..5ec8e36 100644 --- a/system-fileio/ChangeLog.md +++ b/system-fileio/ChangeLog.md @@ -1,5 +1,12 @@ # Changelog for system-fileio +## 0.3.16.6 + +* Fix building on Windows ([issue #31](https://github.com/fpco/haskell-filesystem/issues/31), regression in 0.3.16.5). +* Tested with: + - Cabal and GHC 8.0 - 9.12.0 on Linux + - Stack and GHC 9.8.2 on Linux, macOS and Windows. + ## 0.3.16.5 * Fix building of the testsuite with `unix-2.8`. diff --git a/system-fileio/lib/Filesystem.hs b/system-fileio/lib/Filesystem.hs index 7afa165..550f1cb 100644 --- a/system-fileio/lib/Filesystem.hs +++ b/system-fileio/lib/Filesystem.hs @@ -710,20 +710,17 @@ getModified path = do info <- withHANDLE path Win32.getFileInformationByHandle let ftime = Win32.bhfiLastWriteTime info stime <- Win32.fileTimeToSystemTime ftime - - let date = fromGregorian - (fromIntegral (Win32.wYear stime)) - (fromIntegral (Win32.wMonth stime)) - (fromIntegral (Win32.wDay stime)) - - let seconds = secondsToDiffTime $ - (toInteger (Win32.wHour stime) * 3600) + - (toInteger (Win32.wMinute stime) * 60) + - (toInteger (Win32.wSecond stime)) - - let msecs = picosecondsToDiffTime $ - (toInteger (Win32.wMilliseconds stime) * 1000000000) - + let + date = fromGregorian + (fromIntegral (Win32.wYear stime)) + (fromIntegral (Win32.wMonth stime)) + (fromIntegral (Win32.wDay stime)) + seconds = secondsToDiffTime $ + (toInteger (Win32.wHour stime) * 3600) + + (toInteger (Win32.wMinute stime) * 60) + + (toInteger (Win32.wSecond stime)) + msecs = picosecondsToDiffTime $ + (toInteger (Win32.wMilliseconds stime) * 1000000000) return (UTCTime date (seconds + msecs)) #else stat <- posixStat "getModified" path