Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 40
Waiting for One File
1. Issue a single SIO operation against one file
2. Continue processing while the I/O takes place
3. Finish the I/O with a call to the WAIT^FILE procedure
Figure 15-3 shows nowait I/O applied to the READ^FILE procedure. The same model
also applies to the WRITE^FILE procedure.
To perform nowait I/O on a file, you must open that file specifically for nowait I/O. You
do so by setting the NOWAIT flag in the OPEN^FILE procedure call:
CALL OPEN^FILE(COMMON^FCB,
DFILE,
!block^buffer!,
!block^bufferlen!,
NOWAIT,
NOWAIT);
The NOWAIT flag opens the file with a wait depth of 1. This means that you cannot
have more than one outstanding I/O operation against one file. Unlike regular
Guardian procedures, SIO procedures do not allow you to open files with a wait depth
greater than 1.
Figure 15-3. Nowait I/O Applied to a Single SIO File
Note. Unlike file system I/O, SIO allows you to perform waited I/O against a file that was
opened for nowait I/O. In the READ^FILE or WRITE^FILE procedure you specify a zero in the
nowait parameter or omit the parameter. However, you cannot request a nowait operation
against a file that is open for waited operations.
VST074.VSD