You can bypass the normal record-b y-record input and output, instead receiving large data transfers by specifying m ultirecord mode (MR) b y using the multirecord option parameter in the HPFOPEN or FOPEN call, or by using the :FILE command. For detailed information and examples on m ultiple record transfers, refer to Accessing Files Pr ogrammer's Guide (32650-90017).

Data Transfer Control Operations

To move a record pointer to a particular place without necessarily transferring data, the following intrinsics perform three t ypes of record selection:

FSPACE , provides spacing. It mo ves the record poin ter backward or forward. FPOINT , provides pointing. It resets the record poin ter. FCONTROL , provides rewinding. It resets the record poin ter to record 0.

For detailed information and examples on spacing, poin ting, and rewinding, refer to Accessing Files Programmer's Guide (32650-90017). For detail information on FSPACE , FPOINT , and FCONTROL , refer to MPE/iX Intrinsics R eference Manual (32650-90028).

Reading from a File

There are several ways to move data to a program from a disc ￿le or device ￿le. The File System intrinsics used for reading data from a ￿le are:

FREAD reads a logical record or a portion of a record from a ￿le to a program.

FREADDIR reads a speci￿c logical record or portion of a record from a random access opened disc ￿le to a program.

READ reads a character string from the job or session input device ( $STDIN ) to a program.

READX reads a character string from the job or session input device, ( $STDINX ) to a program.

FREADLABEL reads a user ￿le label from a disc ￿le or labeled magnetic tape ￿le to a program.

By referencing a poin ter to an open mapped ￿le.

If the standard input device ( $STDIN ) and the standard list device ( $STDLIST ) are opened with an HPFOPEN or FOPEN intrinsic call, the FREAD and FWRITE intrinsics can be used with them. For example, you can use the FREAD intrinsic to transfer information en tered from a terminal to a bu￿er in the stac k, and you can use the FWRITE intrinsic to directly transfer information from the stac k to the standard list device.

You can use the FREADDIR intrinsic to read a record from a ￿le opened b y the HPFOPEN or FOPEN intrinsic and transfer the record to an array in the stac k. When FREADDIR reaches the end of a ￿le, the end-of-￿le condition code CCG is returned. If FREADDIR does not successfully read information, a CCL condition code is returned.

When a labeled tape ￿le has been opened, y ou can use the FREAD intrinsic to read data from the opened ￿le. The system uses the bloc k size, record size, and ￿le format on the tape label to determine the amoun t of data to read. You can call FGETINFO or FFILEINFO to obtain these values.

You can use the FREADLABEL intrinsic to read a user-de￿ned label on a labeled magnetic tape ￿le. To read a user-de￿ned header, a program m ust call FREADLABEL before issuing the

6-32 File System