2 gig string/serial file limit.

Started by Michael Greer, February 05, 2020, 10:10:34 AM

Previous topic - Next topic

Michael Greer

Has anyone figured out a clever way to bypass the limit on writing serial files larger than the 2 gig limit.  I can do it with a shell script on *nix, but I don't really want to pursue that.  I'd like something that is O/S agnostic and will work in *nix and windows.

Mike King

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

Mike King
President - BBSysco Consulting - http://www.bbsysco.com
eMail: mike.king@bbsysco.com