maxBound fileSize is dangerously small on windows #16
System.PosixCompat.Files.fileSize is defined to be a FileOffset, just like System.Posix.Files.fileSize.
But, on Windows, maxBound:: FileOffset = 2147483647.
I have had to avoid using fileSize at al in my program because of this gotcha. (hFileSize doesn't have this problem; it will return the real size of a multi-gb file on Windows).
I don't know how to fix this library. Changing the PosixCompat version of FileStatus to use an Integer would work, but it would break compatability between unix and windows for users of this library. Maybe ghc is at fault for using such a small type for FileOffset on Windows?
The text was updated successfully, but these errors were encountered:
I don't want to break compatibility between the unix and windows versions of this library as that is the whole point of the library.
This is a tricky situation, as
This page seems to shed a little bit of light: http://stackoverflow.com/questions/9073667/where-to-find-the-complete-definition-of-off-t-type
Apparently in GCC you can use