FIX: No Check for OPENing Same File with Different PATH

Last reviewed: September 16, 1997
Article ID: Q84624
4.00 4.01 4.10 5.00 | 4.00 4.01 4.10 5.00
MS-DOS              | OS/2
kbprg kbbuglist kbfixlist kberrmsg

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS, versions 4.0, 4.01, 4.1, and 5.0
  • Microsoft FORTRAN for OS/2, versions 4.0, 4.01, 4.1, 5.0

SYMPTOMS

In a Microsoft FORTRAN program, the same file may not be connected to more than one unit at a time. However, programs compiled with Microsoft FORTRAN version 4.0, 4.01, 4.1, or 5.0 can open files with the same filename but with a different path specification without generating the expected error.

STATUS

Microsoft has confirmed this to be a problem in the FORTRAN compiler versions 4.0, 4.01, 4.1, and 5.0. This problem was corrected in Microsoft FORTRAN 5.1.

MORE INFORMATION

The code below should generate the following error:

   run-time error F6413: OPEN(Test.Dat)
   - file already connected to a different unit

The error should be generated on the second OPEN statement; however, with versions earlier than FORTRAN version 5.1, the error is generated only on the third OPEN statement. The program must be on the root of the C drive to demonstrate the error.

Sample Code

      PROGRAM OpenError

      OPEN (1, FILE = 'C:Test.DAT')
      WRITE (*,*) 'C:Test.DAT Opened'  ! First path.

      OPEN (2, FILE = 'Test.DAT')      ! Second path, same file:
                                       ! should generate error.
      WRITE (*,*) 'Test.DAT Opened'

      OPEN (3, FILE = 'C:Test.DAT')    ! Error finally generated.
      WRITE (*,*) 'C:Test.DAT Opened Again'

      END


Additional reference words: 4.00 4.10 5.00 buglist4.00 buglist4.01
buglist4.10 buglist5.00 fixlist5.10
KBCategory: kbprg kbbuglist kbfixlist kberrmsg
KBSubcategory: FORTLngIss
Solution Type : kbfix


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: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.