Named Scratch Files - Proposed Response to WG5

To:	J3

From:	Craig Dedo

Date:	August 14, 2001

Subject:	Named Scratch Files - Proposed Response to WG5

Issue

In paper WG5/N1454, WG5 proposes:

2. At [174:18] it is not specified what happens if STATUS="SCRATCH" and FILE=... are both specified, and the specified file exists. Because of this problem, and the fact that the desired functionality can be provided with named files, WG5 prefers that the named scratch file facility be deleted.

Analysis

There is no problem. It is not specified at [174:18] what happens in this case because it is already specified at [171:7-8], immediately prior to rule R904:

"If an existing file is not connected, execution of an OPEN statement that connects that file with a STATUS of SCRATCH is not permitted."

This language was expressly approved by J3 at meeting #142 on August 12, 1997, when it unanimously approved the edits in paper 01-193r1. There is similar language in the Technical Specification of that paper, although J3 never debated or voted on the Technical Specification:

"It is illegal to open a scratch file with the same name as an existing file that is not open."

This situation is similar to several other situations in chapter 9 in which certain actions in I/O statements are either expressly not permitted or else the prohibition can be deduced from exiting provisions in the normative text. One such provision is at [171:5-6], which is immediately preceding the statement in question:

"If a file is already connected to a unit, execution of an OPEN statement on that file and a different unit is not permitted."

The similarity of these various conditions indicates that it is an I/O error condition if a program tries to open an existing file with STATUS= "SCRATCH". Thus, the Fortran processor should handle it just like any other I/O error condition, i.e., according to the provisions of 9.5.3 and 9.9.

Edits

No edits are necessary.

References

01-007r2, Fortran 2000 Draft

01-317, What is an Input/Output Error?

WG5/N1454, comments arising from subgroup review of Section 9

97-162r2, Named Scratch Files

97-193r1, Edits - Named Scratch Files

[End of J3 / 01-316]