std.stdio.File.seek error

Nicholas Wilson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 13 05:21:11 PDT 2016


On Sunday, 13 March 2016 at 10:32:41 UTC, stunaep wrote:
> I have a very large file I need to read data from at certain 
> positions, but I have run into this error
>> std.conv.ConvOverflowException at std\conv.d(1328): Conversion 
>> positive overflow
> when seeking to 6346890680. Seeking to smaller values such as 
> 3580720 work with no problem. The file is well over 8GB, so it 
> must be able to read data at positions that high.

are you on a 32 or 64 bit system?
You could try 2 or more consecutive relative seeks in place of an 
absolute seek.
i.e.
File f = ... ;
f.seek(173445340 , SEEK_SET);
f.seek(173445340 , SEEK_REL);
also what does
f.seek(0,SEEK_END);
writeln(f.tell());
print?





More information about the Digitalmars-d-learn mailing list