BUG: Share='DENYNONE' Does Not Grant Full Share Privileges

Last reviewed: July 13, 1995
Article ID: Q106722
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 4.0, 4.1, 5.0, and 5.1
  • Microsoft FORTRAN for OS/2, versions 4.1, 5.0, and 5.1
  • Microsoft FORTRAN PowerStation for MS-DOS, versions 1.0 and 1.0a

SYMPTOMS

Assuming SHARE.EXE is loaded, if a FORTRAN application opens a file with share='DENYNONE', attempting to access that open file from a FORTRAN PowerStation application will generate the following error:

   run-time error F6414: OPEN(file_name)
   - access not allowed

If the open file is accessed from an MS-DOS prompt or from Windows, the following error will be generated:

   Sharing violation reading drive C
   Abort, Retry, Fail?

(Note that the above error assumes the open file is on drive C.)

RESOLUTION

If possible, do not load SHARE.EXE. If SHARE must be used, applications created with FORTRAN version 5.1 or earlier can successfully access files opened with share='DENYNONE'.

If you are using the maintenance release of FORTRAN PowerStation, version 1.0a, the work around is to add the attribute mode='readwrite' in the open statement, like this:

     character*30 a
       open (2, file='test.for',
+mode='readwrite',share='DENYNONE')
       read (2,'(A)') a
       print *, a
       read *
       end


STATUS

Microsoft has confirmed this to be a problem in FORTRAN PowerStation versions 1.0 and 1.0a for MS-DOS.

FORTRAN PowerStation version 1.0 can be differentiated from the maintenance release version 1.0a by invoking the linker. Typing "link32 | more" from \F32\BIN directory will show version 2.8 for FORTRAN PowerStation version 1.0, and it will show version 1.0f for the maintenance release version 1.0a.

MORE INFORMATION

To duplicate the error, follow these steps:

  1. Make sure SHARE.EXE is loaded. Note that Windows for Workgroups automatically loads SHARE.

  2. Start Windows.

  3. Build the sample code TEST.FOR using the FORTRAN PowerStation.

  4. From a Windows MS-DOS prompt, run TEST.EXE; it will pause after displaying one line from TEST.FOR.

  5. Open a second Windows MS-DOS prompt and run TEST.EXE again; the following incorrect error will be displayed:

          run-time error F6414: OPEN(test.for)
          - access not allowed
    

  6. In the second prompt, type "TYPE TEST.FOR". The following will be displayed:

          Sharing violation reading drive C
          Abort, Retry, Fail?
    

If TEST.FOR is compiled with FORTRAN version 5.1 or earlier, step 5 will not generate the F6414 error, but step 6 will still fail.

Sample Code (TEST.FOR)

Compile Options: None

       character*30 a
       open (2, file='test.for', share='DENYNONE')
       read (2,'(A)') a
       print *, a
       read *
       end


Additional reference words: 1.00 5.10 5.00 4.10 4.00a 4.00
KBCategory: kbtool kbbuglist kberrmsg
KBSubCategory: FLIss


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.

Last reviewed: July 13, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.