Microsoft KB Archive/84624

= FIX: No Check for OPENing Same File with Different PATH =

Article ID: 84624

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 4.0
 * Microsoft FORTRAN Compiler 4.01
 * Microsoft FORTRAN Compiler 4.1
 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 4.0
 * Microsoft FORTRAN Compiler 4.01
 * Microsoft FORTRAN Compiler 4.1
 * Microsoft FORTRAN Compiler 5.0

-



This article was previously published under Q84624



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 query words: 4.00 4.10 5.00 buglist4.00 buglist4.01 buglist4.10 buglist5.00 fixlist5.10

Keywords: kbfix KB84624

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.