Binary files (SAM)
Fixed record length (F) is the default. When a file is closed, the last record is padded with binary zeros (if necessary). If this file is opened again and data is written at the end of the file a new record is started. New data is therefore written after the binary zeros.
If variable record length is used (V or U), new data can be written on a byte-specific basis. Variable record lengths do, however, tend certain loss of performance with positioning operations (e.g. fseek
/fseek64
, ftell
/ftell64
).
Binary files (PAM)
In order to permit byte-specific updating of PAM files (after closing and reopening), the
C runtime system writes administrative data at the end of the file. This data is maintained in a consistent state at the time the file is opened and closed. For this reason, concurrent processing of a PAM file by different tasks is not possible if the file is extended by one of the participating tasks.
The C runtime system does not set any locks. If data is modified by several users, inconsistent states might result.
Text files (SAM, ISAM)
When SAM or ISAM files are processed in update mode, the original record length must not be changed when modifying existing records. This means that a newline character (\n) must not be changed to another character or vice versa.