Announcement

Collapse
No announcement yet.

How big can I append

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How big can I append

    I was wondering what the limit is when appending to sequential files.


    ------------------

  • #2
    I know you can APPEND to files using BINARY access up to the limit of the SEEK verb, which is a long integer. Not sure what happens using sequential input.

    Why don't you write a little test program, and see where and why an attempt to APPEND fails?
    Code:
    DataBlock$ = SPACE$(16384)
    ON ERROR RESUME NEXT
    OPEN "tesfile.dat" for APPEND AS #1
    DO
      PRINT #1, dataBlock
      E = ERR
      IF E= 0 THEN
        FileSize = FileSize + 16384
      ELSE
        PRINT "APPEND failed when filesize=" & STR$(FileSize) & "with error#" & STR$(E)
        EXIT DO
      END IF
    LOOP
    CLOSE #1
    MCM


    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      One note: the FILESIZE var will need to be at least a DWORD, and preferably a QUAD integer to measure the file size without worrying about overflowing the variable as the file itself crosses the 2Gb mark.

      On my Win2K system (FAT32 partition), this little test app hit just over 2.8Gb when the drive ran out of space!

      On a NTFS partition (10.8Gb free), it was able to fill the entire drive.

      On FAT16 partitions, the limit will be 2Gb. On NTFS/FAT32, the file can be as large as the drive and/or O/S can support. However, random-access on a file above 2Gb will be problematic...



      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]

      Comment


      • #4
        Thank you both. I also ran a test program but I stopped it at about
        50000 lines which gave me a file of over 2Mb. This is bigger than I
        need.

        ------------------

        Comment

        Working...
        X