Microsoft KB Archive/43065

PRB: Read-only File Fails to Generate F6421 Error PSS ID Number: Q43065 Article last modified on 02-11-1993

4.00 4.01

MS-DOS

Summary:

SYMPTOMS When an application developed in Microsoft FORTRAN attempts to write to a read-only file, the write does not succeed but does not report a run- time error. The compiler is designed to generate the following error message:

run-time error F6421: - file read-only or locked against writing STATUS Microsoft has confirmed this to be a problem in FORTRAN versions 4.0 and 4.01. This problem was corrected in FORTRAN version 4.1.

More Information:

The following code should generate a “F6421 file read-only or locked against writing” error when the A.B file is read-only.

Sample Code
C Compiler options required: None

OPEN (1, FILE = 'A.B', MODE = 'READ', ACCESS = 'DIRECT', 1  RECL = 10) WRITE (1, REC = 1) 'TESTING  ' END Additional reference words: 4.00 4.01

=
================================================================

Copyright Microsoft Corporation 1993.