Visible to Intel only — GUID: GUID-541CCA30-DFE4-46AF-AC2C-B41CA0C3D711
Visible to Intel only — GUID: GUID-541CCA30-DFE4-46AF-AC2C-B41CA0C3D711
OPEN: SHARE Specifier
The SHARE specifier indicates whether file locking is implemented while the unit is open. It takes the following form:
SHARE = shr
shr |
Is a scalar default character expression. On Windows* systems, this expression evaluates to one of the following values:
On Linux* and macOS systems, this expression evaluates to one of the following values:
|
On Windows systems, the default is 'DENYWR'. However, if you specify compiler option fpscomp general or the SHARED specifier, the default is 'DENYNONE'.
On Linux and macOS systems, no restrictions are applied to file opening if you do not use a locking mechanism.
'COMPAT' is accepted for compatibility with previous versions. It is equivalent to 'DENYNONE'.
Use the ACCESS specifier in an INQUIRE statement to determine the access permission for a file.
Be careful not to permit other users to perform operations that might cause problems. For example, if you open a file intending only to read from it, and want no other user to write to it while you have it open, you could open it with ACTION='READ' and SHARE='DENYRW'. Other users would not be able to open it with ACTION='WRITE' and change the file.
Suppose you want several users to read a file, and you want to make sure no user updates the file while anyone is reading it. First, determine what type of access to the file you want to allow the original user. Because you want the initial user to read the file only, that user should open the file with ACTION='READ'. Next, determine what type of access the initial user should allow other users; in this case, other users should be able only to read the file. The first user should open the file with SHARE='DENYWR'. Other users can also open the same file with ACTION='READ' and SHARE='DENYWR'.