KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q36611: Share Problems Using sopen and Incorrect oflag

Article: Q36611
Product(s): See article
Version(s): 5.00 5.10
Operating System(s): MS-DOS
Keyword(s): ENDUSER | docerr | mspl13_c
Last Modified: 12-OCT-1988

The "important" note on Page 550 of the "Microsoft Optimizing 5.1
Compiler Run-Time Library Reference" manual has an error in the second
condition listed as causing problems when opening a new file with the
sopen function under DOS Versions 3.00, 3.10, or 3.20 with SHARE
installed.

"With oflag set to any combination that includes O_FLAG..." is
incorrect. There is no O_FLAG setting available. The oflag setting
should be O_CREAT | O_RDWR. This oflag setting with pmode set to
S_IREAD requires that shflag be set to SH_COMPAT to avoid problems
with the new file created by sopen.

The problems that can occur when the wrong sopen options are used
include not opening the new file, or opening the new file but not
being able to write to it resulting in a file of zero length.

These problems may also occur in DOS Version 3.30.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.