Phobos is unable to seek/position positions that are > int.max --- import std.stdio; import std.string; import std.stream; int main(string[] args){ auto file = new BufferedFile(args[1]); file.seek(cast(ulong)int.max + cast(ulong) atoi(args[2]), SeekPos.Set); writefln("%d", file.position); return 1; } --- Problem also happens with trying to use MMFile with files larger than int.max. Probably related to bug 3409.
This strikes me as a mistake in the Phobos declaration of seek(). The underlying stdio fseek() function can only take longs as offsets, and Phobos' seek() is defined the same way; however, a 'long' in C almost always corresponds to an 'int' in D. It's definitely a bug one way or the other, but to work around it you may want to use offsets from SEEK_CUR instead of SEEK_SET.
This has since been fixed: https://github.com/D-Programming-Language/phobos/commit/3eb9454c78bf6000c773695c03b2ca4bc4babb3a#diff-7945921c543e1ab7460797aeb759d7c5L521