1 Introduction

The FIO/RIO package is intended for handling record oriented files (e.g. simple text files) in both ADAM tasks and stand-alone FORTRAN programs. Although most bulk data will be stored in HDS files, there are occasions when the use of HDS is not appropriate. Writing formatted sequential files that are intended for printing as reports is one obvious example. When it is necessary to read and write record oriented files, then the use of FIO can ease the writing of such programs and will assist in the production of portable software.

The essential difference between the FIO and RIO routines is that FIO handles sequential files and RIO handles direct access files (also known as random access files, hence the R in RIO). The FIO routines are primarily intended for handling formatted, sequential files, but some can also process unformatted, sequential files. Formatted, sequential access files may have the first character of each record interpreted as a carriage control character when the file is printed. Whether or not a formatted file contains carriage control characters can be specified when the file is created. RIO routines are primarily used to handle unformatted, direct access files, although some can handle formatted, direct access files as well.

FIO and RIO use a common table of file descriptors so that file descriptors created by RIO routines may be used with appropriate FIO routines: e.g. FIO_FNAME returns the filename associated with a file descriptor obtained via either FIO or RIO.

The normal Starlink ‘inherited status’ error handling strategy is employed throughout. Any FIO/RIO routine that fails will report an error and set the STATUS argument to an appropriate value. Symbolic constants for these STATUS values are given in appendix E.