Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 24
Opening SIO Files: Simplest Form
To clear a flag, set the flag bit in flags-mask but not in flags (because the flags
parameter defaults to 0). For example:
FLAGS^MASK := AUTO^TOF;
CALL OPEN^FILE(COMMON^FCB,
OUTFILE,
!block^buffer!,
!block^bufferlen!,
!flags!,
FLAGS^MASK);
If AUTO^TOF is not specified in flags-mask, then the flag value for the file is
unchanged regardless of the value in flags. Refer to the Guardian Procedure Calls
Reference Manual for a complete list of flag values.
Opening SIO Files: Simplest Form
To open an SIO file, you supply the OPEN^FILE procedure with the names of the file
FCB and the common FCB. The operating system responds as follows:
Opens the file specified by FCB name. The file attributes depend on how the
attributes were set in the FCB by the SET^FILE calls or Assign messages.
Associates the file with the common FCB.
The following example shows the use of the OPEN^FILE procedure in its simplest form
to open the input file:
CALL OPEN^FILE(COMMON^FCB,
INFILE);
Creating SIO Files
You can use the OPEN^FILE procedure to create and open a file. To do so you must
perform the following operations:
1. Set up the file FCB with write-only access.
2. Issue an OPEN^FILE procedure call with the AUTO^CREATE flag set. The
AUTO^CREATE flag is set by default.
The following example creates an SIO file:
CALL SET^FILE(OUTFILE,
ASSIGN^OPENACCESS,
WRITE^ACCESS);
.
.
FLAGS := AUTO^CREATE;
FLAGS^MASK := AUTO^CREATE;
CALL OPEN^FILE(COMMON^FCB,
OUTFILE,
!block^buffer!,
!block^bufferlen!,
FLAGS,FLAGS^MASK);