You need to use a binary write as opposed to a serial file write. Serial IO Is limited to 2GB whereas using raw binary IO will allow access to any size file.
The following will create you a 4gb file (assuming the OS allows it)
serial "bigone"
open lock (1,isz=-1)"bigone"
r$=dim(1000,"This is a test")
!
for i=1 to 4000000000/len(r$)
write record (1)r$
if i|10000=0 \
then print i
next
!
print fin(1,"FILELENGTH")
end