Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 16
Setting Up File Access
If the access mode is not specified, its default value depends on the file type as
follows:
For more details about access modes, refer to Section 3, Coordinating Concurrent File
Access.
Specifying the Exclusion Mode
You can set the exclusion mode of a file to shared, exclusive, or protected.
Use the ASSIGN command to set the exclusion mode at run time. You specify the
exclusion mode by setting the exclusion-spec parameter to SHARED,
EXCLUSIVE, or PROTECTED. The following example assigns shared access to the
file associated with the logical name INPUT^FILE:
2> ASSIGN INPUT^FILE,,SHARED
Use the SET^FILE ASSIGN^OPENEXCLUSION operation to programmatically set the
exclusion mode. You set the exclusion mode by setting the new-value parameter to
SHARE, EXCLUSIVE, or PROTECTED. The following example sets the exclusion
mode to shared for the file associated with the INFILE FCB:
CALL SET^FILE(INFILE,ASSIGN^OPENEXCLUSION,SHARE);
If the exclusion mode is not specified, its default value depends on the access mode as
follows:
For more details about exclusion modes, refer to Section 3, Coordinating Concurrent
File Access.
File Type Access Mode
Operator
pro
cess
Read/write
Process Read/write
$RECEIVE Read/write
Disk file Read/write
Terminal Read/write
Printer Write
Magnetic tape Read/write
Access
Mode Exclusion Mode
Read only Shared mode for terminals, otherwise protected mode
Write only Shared mode for terminals, otherwise exclusive mode
Read/write Shared mode for terminals, otherwise exclusive mode