| Application Programmer's I/O Guide - S-3695-35 | ||
|---|---|---|
| Prev Section | Chapter 3. Fortran I/O Extensions | Next Section |
The logical record I/O routines provide word or character granularity during read and write operations on full or partial records. The read routines move data from an external device to a user buffer. The write routines move data from a user buffer to an external device.
The following list briefly describes these routines; for details about the routines discussed in this section, see the individual man pages for each routine.
READ and READP move words of data from disk or tape to a user data area. READ reads words in full-record mode. READP reads words in partial-record mode.
READ positions the file at the beginning of the next record after a READ. READP positions the file at the beginning of the next word in the current record after a READP. If foreign record translation is enabled for the specified unit, the bits from the foreign logical records are moved without conversion. Therefore, if the file contained IBM data, that data is not converted before it is stored. The following are examples of calls to READ and READP:
CALL READ (7,ibuf,icnt,istat,iubc) CALL READP(8,ibuf,icnt,istat,iubc) |
READC(3F) reads characters in full-record mode. READCP reads characters in partial-record mode. Characters are moved to the user area with only one character per word and are right-justified in the word. The bits from foreign logical records are moved after conversion when foreign record translation is enabled for the specified unit. The following are examples of calls to READC and READCP:
CALL READC (9,ibuf,icnt,istat) CALL READCP (10,ibuf,icnt,istat) |
READIBM reads IBM 32-bit floating-point words that are converted to Cray 64-bit words. The IBM 32-bit format is converted to the equivalent Cray 64-bit value and the result is stored. A conversion routine, IBM2CRAY(3F), converts IBM data to Cray format. A preferred method to obtain the same result is to read the file with an unformatted READ statement and then convert the data through a call to IBM2CRAY. The following is an example of a call to READIBM:
CALL READIBM (7,ibuf,ileng,incr) |
WRITE(3F) writes words in full-record mode. WRITEP writes words in partial-record mode. WRITE and WRITEP move words of data from the user data area to an I/O buffer area. If foreign record translation is enabled, no data conversion occurs before the words are stored in the I/O buffer area. The following are examples of calls to WRITE and WRITEP:
CALL WRITE (8,ibuf,icnt,iubc,istat) CALL WRITEP (9,ibuf,icnt,iubc,istat) |
WRITEC(3F) writes characters in full-record mode. WRITECP writes characters in partial-record mode. Characters are packed into the buffer for the file. If foreign record translation is enabled, the characters are converted and then packed into the buffer. The following are examples of calls to WRITEC and WRITECP:
CALL WRITEC (10,icbuf,iclen,istat) CALL WRITECP (11,icbuf,iclen,istat) |
WRITIBM writes Cray 64-bit values as IBM 32-bit floating-point words. The Cray 64-bit values are converted to IBM 32-bit format, using a conversion routine, CRAY2IBM(3F). After this conversion, you can use an unformatted WRITE statement to write the file. The following is an example of the call to WRITIBM:
CALL WRITIBM (12,ibuf,ilen,incr) |
| Prev Section | Table of Contents | Title Page | Next Section |
| Asynchronous queued I/O (AQIO) routines | Up one level | Tape and Named Pipe Support |