Code: Select all
size := 0x100000005 ; about 4GB, DWORD_MAX + 5
VarSetCapacity(bigData, size, 0xFF)
FileOpen("large.bin", "w").RawWrite(&bigData, size) ; 5 bytes written
or make it default to DWORD_MAX if it exceeds it
or make it throw if it exceeds DWORD_MAX
or change TextStream so it uses size_t-based functions