next up previous 204
Next: FIO_READF - Fast read sequential record
Up: Routine Descriptions
Previous: FIO_PUNIT - Release a unit number


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


next up previous 204
Next: FIO_READF - Fast read sequential record
Up: Routine Descriptions
Previous: FIO_PUNIT - Release a unit number

FIO/RIO FORTRAN file I/O routines
Starlink User Note 143
P M Allan
A J Chipperfield
20 July 2001
E-mail:starlink@jiscmail.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils