PxPlus User Forum

Twitter Twitter Twitter

Author Topic: 2 gig string/serial file limit.  (Read 313 times)

michaelgreer

  • Silver Member
  • ***
  • Posts: 48
    • View Profile
2 gig string/serial file limit.
« 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.

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3359
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: 2 gig string/serial file limit.
« Reply #1 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