I am running into problems interacting with a huge fixed length record data file. The file is over 14 GB in size. I first noticed a problem when I saw the return value from the System.Filesize()
function was far less than the actual number of records in the huge file, given the number of bytes in the file and the length of each record. (System.Filesize returns the number of records in an untyped file given the record size specified during the Reset()
call. It does not return the number of bytes in the file). I chalked it up to the return type of System.Filesize()
being a Longint instead of an Int64.
I worked around the initial problem by calling GetFileSizeEx()
and calculating the number of records myself. Unfortunately, BlockRead()
also fails when trying to access records in the file whose offset is deep into the file. I'm guessing that again there are values being used that are overflowing somewhere in the code.
Is there a replacement module out for Delphi 6 there that can handle huge files and is a substitute for the System unit file I/O calls? I'm trying to avoid rolling my own if I can.