Guardian Programmer's Guide

Table Of Contents
Guardian Programmer’s Guide 421922-014
15 - 1
15
Using the Sequential Input/Output
Procedures
The sequential input/output (SIO) procedures provide a higher-level interface than the
interface provided by using the file system procedures directly. They are intended for
processing sequential I/O streams, particularly of displayable or printable text.
Specifically, they can be used for text that might be directed to or from a variety of text
sources or destinations, such as terminals, printers, spoolers, structured disk files, and
EDIT files. Files opened for SIO access are referred to as SIO files.
SIO procedures provide a convenient way of reading or writing EDIT files as text files,
ignoring such things as line numbers. EDIT files have a higher-level structure that the
file system does not understand but which SIO does understand. An alternative to
using SIO would be to use the IOEdit procedures as described in Section 14, Using the
IOEdit Procedures.
SIO is designed to work with the INITIALIZER, which allows redirection of SIO files
using the Startup message and Assigns.
This section shows how to use the SIO procedures in an application program. It
explains how to program the following operations:
Initialize file control blocks (FCBs) for SIO files using TAL or pTAL DEFINEs.
Open SIO files using the OPEN^FILE procedure.
Retrieve information (such as the current file state and permissions) about SIO
files using the CHECK^FILE procedure.
Read and write to an SIO file using the READ^FILE and WRITE^FILE procedures.
Access files in EDIT format.
Handle nowait input and output.
Communicate with other processes.
Handle system messages using SIO procedures.
Handle the BREAK key.
Handle errors that occur in response to an SIO procedure call.
Close SIO files.
Dynamically initialize FCBs for SIO files without using TAL or pTAL DEFINEs.