It only writes what you tell it to write.
FILES$ = "A:\file.txt"
IF _FILEEXISTS(FILES$) THEN SHELL "del " + FILES$
m$ = SPACE$(1000000&)
s$ = "x"
OPEN FILES$ FOR APPEND AS #1: PRINT #1, m$;: CLOSE #1 ' 'DISPLAY' <--Here, we write 1,000,000 bytes
OPEN FILES$ FOR APPEND AS #1: PRINT LOF(1): PRINT #1, s$;: CLOSE #1 '<-- Here, we only write 1, starting at byte 1,000,001
OPEN FILES$ FOR APPEND AS #1: PRINT LOF(1): PRINT #1, s$;: CLOSE #1 '<-- Here, we only write 1, starting at byte 1,000,002
END
You don't open the file and rewrite over it. You simply append the data you're printing to the end of it.