PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: michaelgreer on February 05, 2020, 10:10:34 AM

Title: 2 gig string/serial file limit.
Post by: michaelgreer on February 05, 2020, 10:10:34 AM
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.
Title: Re: 2 gig string/serial file limit.
Post by: Mike King on February 05, 2020, 11:13:34 AM
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)

Code: [Select]
  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