If you dont mind mixing data types, you can use such a multi-line text
header and end it with something you choose (like "<end header>" on a
line alone). Then you can write the arrays to the same file stream
refnum.

When reading them back, you can use the generic file read, in line
mode, until you read "<end header>".  Then, starting from offset
(current bytestream position), you can read the rest of the data using
the appropriate data type.

This is useful for large data sets that would make large text files or
take a long time converting to strings.  It may be useful to include
the file structure you use in the text header for reference or for
custom file readers capable of handling different file structures.  I
sometimes use this when I know the file structure will probably change
as the writing program is updated, but want a reader that can still
open old file structure formats.

Reply via email to