On 20/04/2015 7:06 a.m., Kenny wrote:
This function works fine for large text files like 100Mb or 1Gb but
failed when I tried to read 6Gb file. This happens on Windows x64.

The possible reason that it uses read(in char[], size_t) function and on
windows it calls GetFileSize. This function returns file size as 32 bit
value. If you need size for files larger then 4Gb then this function
provides out parameter where you can pass reference to another 32 bit
value. But in DMD 2.067 this function is called as

auto size = trustedGetFileSize(h, null);

thus we never get correct size for files larget then 4Gb.

Is it a bug?

It should probably be using GetFileSizeEx instead.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364957(v=vs.85).aspx

So yes, bug.

Reply via email to