SEEKING IN FILES BIGGER THAN 2 GIG
Posted on 2006-06-23
I have a routine that reads in a file and as it reads the file in it writes out an index file like
tdelimit_struct = record
skey:array[1..10] of char;
(* spos = start position in file, ssize is no of characters to read in *)
Once the data is read in a third party dll sorts the data and then supplies me back just the record no's i need for the sorted
This is why the index is written as the data coming in can be delimitted or fixed field.
To read the data back in I have a tfilestream method....
(* get record from sort , read sort key from main index then*)
(* and to seek a record *)
-- PROBLEM HERE ---------
The problem is when the file is over 2 gig i get a range check error on the seek - despite the fact i have a int64?
The offset crashing it was 2152430441 (which is over 2gig).
I can seek seekf is meant to read over 2gig files?
I had similar problems with getting the size of the original files but fond code to fix this but the read is killing it?
This is in delphi7.