￿rst FREAD for the ￿le. Execution of the ￿rst FREAD causes MPE/iX to skip past an y unread user-de￿ned header labels.

Other specialized read in trinsics are READX and FREADLABEL .

For detailed information on reading a ￿le, refer to Accessing Files Pr ogrammer's Guide (32650-90017).

Writing to a File

You can move data from a program to a disc ￿le or to a device ￿le in sev eral ways. The File System intrinsics used for writing the data are as follows:

FWRITE writes a logical or ph ysical record or portion of a record from y our program to a ￿le on any device.

FWRITEDIR writes a speci￿c logical record from a program to a disc ￿le.

PRINT prints a character string from a program to the job or session listing device, $STDLIST .

FWRITELABEL writes a user ￿le label from y our program onto a disc ￿le or labeled magnetic tape ￿le.

By assigning a v alue to a location speci￿ed b y a pointer 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 these devices. For example, the FWRITE intrinsic can be used to transfer information from a bu￿er in your process stac k directly to the standard list device.

A program can use the FWRITEDIR intrinsic to read records from one ￿le and write them, in reverse order, into a second ￿le. You can use the FGETINFO intrinsic to locate EOF in the ￿le to be read. This information is returned to the program in a v ariable.

You can write to either a labeled or an unlabeled magnetic tape ￿le. W riting to a labeled tape ￿le di￿ers from writing to an unlabeled tape ￿le when the user program attempts to write over or beyond the physical end-of-tape ( EOT) marker.

For detailed information on writing to a ￿le, refer to Accessing Files Pr ogrammer's Guide (32650-90017).

Updating a File

The FUPDATE intrinsic updates a logical record of a disc ￿le. It a￿ects the last logical record (or bloc k for NOBUF ￿les) accessed by any intrinsic call for the ￿le named and writes information from a bu￿er in the stac k into this record. Following the update operation, the record pointer is set to indicate the next record position.

As a physical data storage device, magnetic tape is not designed to enable the replacemen t of a single record in an existing ￿le. An attempt to perform this t ype of operation causes problems in main taining the in tegrity of records on the tape. Magnetic tape ￿les, therefore, should not be main tained (updated) on an individual record basis, but should be updated during copy operations from one ￿le to another. F or detailed information on updating ￿les, refer to Accessing Files Pr ogrammer's Guide (32650-90017).

File System 6-33