File Sharing Modes Available with the sopen() Function

ID: Q66129


The information in this article applies to:


SUMMARY

An application can open files for sharing using the sopen() run-time library function. The application specifies the desired sharing by passing an integer argument to sopen().


MORE INFORMATION

The shflag parameter to the sopen() function can contain one of the five manifest constants. The table below lists the constants and their uses.

SH_COMPAT
Compatibility mode. Other programs can open the file and perform read or write operations if every program specifies compatibility mode. This sharing mode is used by the open() function when an application runs in the MS-DOS operating system. This sharing mode is not available in the OS/2 operating system.

SH_DENYNO
Deny none. Other programs can open the file and perform read or write operations. However, another program cannot open the file in compatibility mode. This the sharing mode used by the open() function when an application runs in the OS/2 operating system.

SH_DENYRW
Deny all. Other programs cannot open the file.

SH_DENYWR
Deny write. Other programs cannot open the file in compatibility mode or to obtain write access.

SH_DENYRD
Deny read. Other programs cannot open the file in compatibility mode or to obtain read access.

In a network environment with the MS-DOS operating system, the SH_COMPAT mode is recommended if the file is shared for reading and for writing. For more information about file modes, see Article 7, "File and Record Management," in the "MS-DOS Encyclopedia" (Microsoft Press).

Additional query words: kbinf 6.00 6.00a 6.00ax 7.00 1.00 1.50


Keywords          : kb16bitonly 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: July 21, 1999