MPE/iX Intrinsics Reference Manual (32650-90875)
Chapter 6 253
Command Definitions (FLUSHLOG-GETUSERMODE)
FREAD
>0 Length in half words
If
length
is larger than the size of the logical record, and the multirecord
aoption
in FOPEN/HPFOPEN was not specified, transfer is limited to the
length of the logical record. If the multirecord
aoption
in
FOPEN/HPFOPEN is specified, transfer continues until either
length
is
satisfied or end-of-data is encountered, and each transfer begins at the
start of the next physical record (block). Any data remaining in the last
physical record read is inaccessible. Data transfer for byte stream files
continues until either
length
bytes are read or an end-of-file occurs.
Operation Notes
When the logical end-of-data is encountered, CCG (0) is returned to the process:
• On magnetic tape, the end-of-data is a physical indicator such as a tape mark. When
the program reads a file that spans more than one volume of labeled magnetic tape, the
program is suspended until an operator mounts the next tape. CCG (0) is not returned
when end-of-tape is encountered.
• On disk, the end-of-data occurs when there is an attempt to read past the last logical
record of the file. In this case, CCG (0) is returned, and no record is read.
• If the file is embedded in an input source containing commands, an end-of-data occurs
when an EOD command is encountered. End-of-data is indicated by a hardware
end-of-file, including EOF (on $STDIN), any record beginning with a colon (:), or on
$STDINX, by EOD.
• On a standard input device for a job (not a session) JOB, EOJ, or DATA indicate
end-of-data.
When reading from an empty message file and another process has opened that file for
write access, the process waits. If the message file is empty and there are no writers, the
process waits if there is an FCONTROL=45 in effect or if this is the first FREAD after the
reader's FOPEN/HPFOPEN. Otherwise, CCG (0) is returned. If an FREAD is issued against a
message file and an FCONTROL=46 is in effect, the writer's ID and the record type code are
appended to the beginning of the record.
When an old file containing carriage-control characters supplied through the
controlcode
parameter of the FWRITE intrinsic is read, and you specified either the carriage-control
foption
parameter of the FOPEN/HPFOPEN intrinsic, or the CCTL parameter of the FILE
command, the carriage-control byte is read as follows:
Figure 6-1. Carriage Control Byte
+-+----------------------------+
|C| |
|C| Data Read |
|B| |
+-+----------------------------+
CCB = Carriage Control Byte