FIX: No Check for OPENing Same File with Different PATHLast reviewed: September 16, 1997Article ID: Q84624 |
4.00 4.01 4.10 5.00 | 4.00 4.01 4.10 5.00
MS-DOS | OS/2kbprg kbbuglist kbfixlist kberrmsg The information in this article applies to:
SYMPTOMSIn 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.
STATUSMicrosoft 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 INFORMATIONThe code below should generate the following error:
run-time error F6413: OPEN(Test.Dat) - file already connected to a different unitThe 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |