Microsoft KB Archive/66129

{|
 * width="100%"|

File Sharing Modes Available with the sopen Function

 * }

Q66129

-

The information in this article applies to:


 * The C Run-Time (CRT), included with:
 * Microsoft C for MS-DOS, versions 6.0, 6.0a, and 6.0ax
 * Microsoft C/C++ for MS-DOS, version 7.0
 * Microsoft Visual C++, versions 1.0, 1.5

-

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, &quot;File and Record Management,&quot; in the &quot;MS-DOS Encyclopedia&quot; (Microsoft Press).

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

Keywords : kb16bitonly

Issue type :

Technology : kbVCsearch kbAudDeveloper kbCRT