MPE/iX Intrinsics Reference Manual (32650-90905)
Chapter 6 261
Command Definitions (FLUSHLOG-GETUSERMODE)
FREADDIR
FREADDIR
NM and CM callable.
Reads a specific logical record or portion of a record from a direct-access disk file to the
data stack.
Syntax
I16V UDS I16V I32V
FREADDIR(
filenum,buffer,length,lrecnum
);
Parameters
filenum
16-bit signed integer by value (required)
Passes the file number of the file to be read.
buffer
user-defined structure (required)
Returns the record that was read. This structure should be large enough to
hold all of the information to be transferred.
length
16-bit signed integer by value (required)
Passes the number of half words or bytes to be transferred. If this value is
positive, it signifies half words; if negative, bytes. Zero signifies that no
transfer occurs. If
length
is less than the size of the logical record, only
the first
length
half words or bytes are read from the record.
If
length
is larger than the size of the logical record and the multirecord
aoption
in FOPEN/HPFOPEN was not specified, the transfer is limited to the
length of the logical record. If the multirecord
aoption
in FOPEN/HPFOPEN
is specified, the remaining half words or bytes specified in
length
are read
from the next records.
lrecnum
32-bit signed integer by value (required)
The relative number, in the file, of the logical record or block number for
the NOBUF files to be read. A value of zero indicates the first logical record.
(KSAM) Indicates the relative chronological record number where the the
chronological pointer is positioned. Chronological record numbering for
fixed-length records starts with 0 or 1, as specified when the file was built.
Operation Notes
This intrinsic is different than the FREAD intrinsic. The FREAD intrinsic reads only the
record already pointed to by the logical record pointer. Issue the FREADDIR intrinsic only
for disk files composed of fixed-length or undefined-length records. If RIO access is used,
FREADDIR inputs the specified logical record. If the record is inactive, the contents of the
inactive record are transmitted and CCE (2) is returned; there is no indication of the block
containing some inactive records. (FCHECK returns a nonzero error number to distinguish