The locality
of reference flags contain information about how the application is to get
access to the file. The values are as follows:
000
OPEN_FLAGS_NO_LOCALITY (0x00000000)
No locality known.
001
OPEN_FLAGS_SEQUENTIAL
(0x00000100)
Mainly sequential access.
010
OPEN_FLAGS_RANDOM
(0x00000200)
Mainly random access.
011
OPEN_FLAGS_RANDOMSEQUENTIAL
(0x00000300)
Random with some locality.
7
6-4
Sharing Mode flags. This field defines any restrictions
to file access placed by the caller on other processes. The values are as
follows:
001
OPEN_SHARE_DENYREADWRITE (0x00000010)
Deny read/write access.
010
OPEN_SHARE_DENYWRITE
(0x00000020)
Deny write access.
011
OPEN_SHARE_DENYREAD
(0x00000030)
Deny read access.
100
OPEN_SHARE_DENYNONE
(0x00000040)
Deny neither read nor write access (deny none).
Any
other value is invalid.
3
2-0
Access-Mode
flags. This field defines the file access required by the caller. The values
are as follows:
000
OPEN_ACCESS _ READONLY(
0x00000000 )
Read-only access
001
OPEN_ACCESS_WRITEONLY
(0x00000001)
Write-only access
010
OPEN_ACCESS_READWRITE
(0x00000002)
Read/write access.
Any other value is invalid,
as are any other combinations.
File Sharing
File sharing requires the cooperation of sharing processes. This cooperation
is communicated through sharing and access modes. Any sharing restrictions
placed on a file opened by a process are removed when the process closes
the file with a DosClose request.
Sharing Mode
Specifies the type of file access
that other processes may have. For example, if other processes can continue
to read the file while your process is operating on it, specify Deny Write.
The sharing mode prevents other processes from writing to the file but still
allows them to read it.
Access Mode
Specifies
the type of file access (access mode) needed by your process. For example,
if your process requires read/write access, and another process has already
opened the file with a sharing mode of Deny None, your DosOpen request succeeds.
However, if the file is open with a sharing mode of Deny Write, the process
is denied access.
If the file is inherited by a child process, all sharing and access restrictions
also are inherited.
If an open file handle is duplicated by a call to DosDupHandle, all sharing
and access restrictions also are duplicated.
Raw
File System
When a device is opened in the raw file system, the only valid access mode
is OPEN_ACCESS_READWRITE. The valid sharing modes are:
Mode
OPEN_SHARE_DENYNONE
Allows other processes to perform read and write
operations to the device.
OPEN_SHARE_DENYREADWRITE
Locks device and prohibits access to device by
other processes or file systems.
All other flags
are either invalid or not implemented in this release of OS/2.
[Back: DosOpen Parameter - fsOpenFlags]
[Next: DosOpen Parameter - peaop2]