WRITE-FUNCTION (op-code 9)

This routine adds a new record to the passed file. The WRITE routine has three parameters, f, record, and size.

F must be a valid file handle returned by OPEN.
Record     points to the record to add.
Size is the size of the record. If size is zero, then the maximum record size for the file is used.

If the file has keys that allow duplicate values, and one or more of those keys in record match keys that already exist in the file, then F-ERRNO is set to W-DUP-OK. Several file systems cannot detect this condition and in this case, F-ERRNO is set to zero instead.

For keys that allow duplicates, the new record is added such that its keys are placed at the end of the sequence of those keys with the same value. Many file systems do not support this rule, in which case the ordering is defined by the file system.

The WRITE routine does not change the current file position or affect the current key of reference.