FIO_READ

Read sequential record

Description:

Read a record from the file with the specified file descriptor and return the ‘used length’ of the buffer.

Invocation

CALL FIO_READ( FD, BUF, NCHAR, STATUS )

Arguments

FD = INTEGER (Given)
The file descriptor.
BUF = CHARACTER ( ) (Returned)
Variable to receive the record.
NCHAR = INTEGER (Returned)
Variable to receive the number of characters read, ignoring trailing spaces.
STATUS = INTEGER (Given and Returned)
The global status.

Notes:

FIO_READ reflects the behaviour of the underlying Fortran I/O system so identical behaviour on different platforms cannot be guaranteed. In particular, platforms differ in the way they handle records which are terminated by EOF rather than newline. Supported platforms currently behave as follows:
Buffer STATUS NCHAR
Alpha: Trailing spaces added SAI__OK Used length
Solaris: No trailing spaces added FIO__EOF 0
Linux: No trailing spaces added FIO__EOF 0

In the interests of efficiency, the buffer is not cleared before each READ so it is not possible for FIO_READ to find the used length on Solaris or Linux in this case. The programmer may do so if required.

External Routines Used

CHR: CHR_LEN