Accessing Files Programmer's Guide (32650-90885)

Chapter 2 27
Creating A File
The HPFOPEN Intrinsic
13/I32 Exclusive:
Passes a value indicating continuous exclusive access to the file, from open
to close. Use this option when performing a critical operation (for example,
updating the file).
The following values are valid:
0If
itemnum
=11 specifies read only access, read-share
access takes effect. Otherwise, exclusive access takes
effect. Regardless of which access option was selected,
FFILEINFO reports zero. A zero (default) value for the
itemnum
specifies that if the access type is read, directory
read, or no access (
itemnum
11 equal to 0, 8, or 9) then
shared access takes effect; otherwise exclusive access
takes effect.
1 Exclusive access. After the file is opened, any additional
HPFOPEN/FOPEN requests for this file, whether issued by
this process or another process, are prohibited until this
process issues the FCLOSE request or terminates. If any
process is already accessing this file when an
HPFOPEN/FOPEN call is issued with exclusive access
specified, an error status is returned to the process. If
another HPFOPEN/FOPEN call is issued for this file while
exclusive access is in effect, an error code is returned to
the process that issued that HPFOPEN/FOPEN call. Request
exclusive access only if the lock access mode is allowed by
the security provisions for the file. For message files,
specifying this value means that there can be only one
reader and one writer.
Exclusive access cannot be used with directories.
2 Read-Share access (semi-exclusive access). After the file is
opened, concurrent write access to this file through
another HPFOPEN/FOPEN request is prohibited, whether
issued by this process or another process, until this
process issues the FCLOSE request or terminates. A
subsequent request for the read/write or update
itemnum
=11 obtains read access. However, other types of
read access are allowed. If a process already has write
access to the file when this HPFOPEN call is issued, an
error code is returned to the calling process. If another
HPFOPEN/FOPEN call that violates the read-only
restriction is issued while read-share access is in effect,
that call fails and an error code is returned to the calling
process. You can request read-share access only if you are
allowed the lock access mode by the security provisions for
the file. For message files, specifying this value means that
there can be multiple readers, but only one writer.
3 Share access. After the file is opened, this permits