In a Delphi program, I have a dynamic array with 4,000,000,001 cardinals. I'm trying to write (and later read) it do a drive. I used the following:
const Billion = 1000000000;
stream := tFileStream.Create( 'f:\data\BigList.data', fmCreate);
stream.WriteBuffer( Pointer( BigArray)^, (4 * billion + 1) * SizeOf( cardinal));
stream.free;
It bombed out with: ...raised exception class EWriteError with message 'Stream write error'.
The size of the file it wrote is only 3,042,089KB.
Am I doing something wrong? Is there a limit to the size that can be written at once (about 3GB)?