[Issue 14469] file.readText on Win64 doesn't work for files > 4GB.
https://issues.dlang.org/show_bug.cgi?id=14469 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/95fd043dc6d0c945c171f8874761e1399a11252c Fix Issue 14469 - read > 4GB file on Windows x64. https://github.com/dlang/phobos/commit/75f068773ccc0750c2cf865fe2f621a9947723f3 Merge pull request #3218 from artemalive/issue_14469 --
[Issue 14469] file.readText on Win64 doesn't work for files > 4GB.
https://issues.dlang.org/show_bug.cgi?id=14469 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/95fd043dc6d0c945c171f8874761e1399a11252c Fix Issue 14469 - read > 4GB file on Windows x64. https://github.com/D-Programming-Language/phobos/commit/75f068773ccc0750c2cf865fe2f621a9947723f3 Merge pull request #3218 from artemalive/issue_14469 Fix Issue 14469 - read > 4GB file on Windows x64. --
[Issue 14469] file.readText on Win64 doesn't work for files > 4GB.
https://issues.dlang.org/show_bug.cgi?id=14469 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 14469] file.readText on Win64 doesn't work for files > 4GB.
https://issues.dlang.org/show_bug.cgi?id=14469 --- Comment #2 from Kenny Alive --- The above algorithm for reading file has a bug. chunkSize should be calculated like this: uint chunkSize = min(size - totalNumRead, 0x); --
[Issue 14469] file.readText on Win64 doesn't work for files > 4GB.
https://issues.dlang.org/show_bug.cgi?id=14469 --- Comment #1 from Kenny Alive --- Additionally since ReadFile (and ReadFileEx too) can read file in chunks not larger than 4GB the file reading code should be updated to something like this: ulong totalNumRead = 0; while (totalNumRead != size) { uint chunkSize = (size - totalNumRead) & 0x; DWORD numRead = void; cenforce(ReadFile(hFile, cast(ubyte*)lpBuffer + totalNumRead, chunkSize, &numRead, null) != 0 && numRead == chunkSize, name); totalNumRead += chunkSize; } --