[Issue 18017] [External] [DMC] File.size() uses a 32-bit signed integer for size internally (gives wrong results for files over ≈2.1 GB)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 28 18:30:50 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=18017

--- Comment #5 from Steven Schveighoffer <schveiguy at yahoo.com> ---
std.file.getSize works because it *does* use WinAPI directly.

std.stdio.File is based completely on libc's FILE * structure. It can only
support whatever that supports, and that isn't very much. In the case of 32-bit
windows, the library it uses is Digital Mars' C runtime, which has some
difficult limitations, this being one of them.

A potential fix here is to get the handle directly from the FILE * and query it
using WinAPI. But this doesn't fix File.tell(), which is going to use the libc
version.

--


More information about the Digitalmars-d-bugs mailing list