Table 6-7. File Sharing Restriction Options

Access Restrictions

:FILE Parameters

Description

 

 

 

Exclusive Access

EXC

After you open a ￿le, prohibits

 

 

concurrent access in any mode

 

 

through another HPFOPEN/FOPEN

 

 

request by any program

 

 

(including this one), until this

 

 

program issues FCLOSE or

 

 

terminates.

Exclusive Write Access

SEMI

After you open a ￿le, prohibits

 

 

concurrent write access through

 

 

another HPFOPEN/FOPEN request

 

 

by any program (including this

 

 

one), until this program issues

 

 

FCLOSE or terminates.

Sharable Access

SHR

After you open a ￿le, allo ws

 

 

concurrent access in any mode

 

 

through another HPFOPEN/FOPEN

 

 

request by any program

 

 

(including this one), in an y

 

 

session or job (including this

 

 

one).

 

 

 

The Exclusive Access option is useful to update a ￿le and prev ent other users or programs from reading, writing, or altering information that is about to be c hanged.

The Exclusive-write Access option allo ws other accessors to read the ￿le but prev ents them from altering it. F or example, it is useful for updating a parts list, where y ou want to append new part numbers, without prohibiting other users from reading curren t part numbers.

The Sharable Access option allo ws a ￿le to be shared in all access modes b y requests from multiple programs. It is useful for allowing sev eral users to read di￿eren t parts of the same ￿le. E￿ectively, each accessor accesses its o wn copy of the portion of the ￿le in the accessor's bu￿er.

For detailed information on Exclusiv e, Exclusive-write, and Sharable Access, refer to Accessing Files Programmer's Guide (32650-90017).

The multi-access option extends the features of Sharable Access to allow a deeper lev el of multiple access. It mak es the ￿le sim ultaneously available to other accessors in the same job or session and permits them to use the record poin ter and other ￿le-control information. When several concurrently running programs (processes) are writing to the ￿le, the e￿ect on the ￿le is the same as if one program w ere performing all output. Multi-access pro vides truly sequential access by several concurrently running programs.

Global multi-access permits sim ultaneous access to a ￿le b y processes in di￿eren t jobs or sessions. Figure 6-15 sho ws the action resulting from m ulti-access of ￿les.

6-36 File System