S-READ-FUNCTION (op-code 4)

This routine reads the next record in the sequence of records. The S-READ-FUNCTION routine has two parameters, f and record.

F must be a valid file handle returned by S-OPEN-FUNCTION.
Record    points to the area to hold the record read.

If S-READ-FUNCTION succeeds, RETURN-CODE is set to the size of the record read, plus one. If it fails, RETURN-CODE is set to zero. However, if the function fails due to the record being locked, the file pointer is set to the locked record.

Records read in a file open for input only are not locked. Furthermore, most file systems do not block the reading of locked records in a file open for input (this feature depends on the host file system - not all support it). Records read from a file open for I/O are automatically locked unless the external variable f-no-lock is set to a non-zero value, in which case they are treated in the same manner as files open for input.