Bug 3410 – std.stdio.File.tell() doesn't work for files >2GB
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2009-10-16T23:05:00Z
Last change time
2016-04-13T22:04:14Z
Assigned to
nobody
Creator
dsimcha
Comments
Comment #0 by dsimcha — 2009-10-16T23:05:15Z
THe C function returns an int, which wraps around to negative values for files >2GB, and the result of File.tell() is some absurd number that you get when you cast this value to a ulong, I think.
Comment #1 by dsimcha — 2009-10-17T08:45:24Z
Note that std.stream gets this right on Win32 but not Linux by using the Win32 API directly.
Comment #2 by andrei — 2009-10-17T09:01:22Z
(In reply to comment #1)
> Note that std.stream gets this right on Win32 but not Linux by using the Win32
> API directly.
Casting won't help much, we need the long.
Comment #3 by andrei — 2011-06-05T08:54:56Z
Putting this up for grabs as I don't have Windows.