J3/01-296 Subject: Revised answer for Interp 68 From: Malcolm Cohen To: J3 Date: 6th August 2001 ---------------------------------------------------------------------- NUMBER: 000068 TITLE: Asterisks as I/O units KEYWORDS: Asterisk, I/O, unit DEFECT TYPE: Erratum STATUS: J3 consideration in progress Question: 1. Does the Fortran 95 standard require the external unit corresponding to the I/O unit identified by an asterisk for input or output to be the same as the external unit identified by some fixed nonnegative integer value? 2. Can the I/O unit identified by an asterisk for input or output correspond to more than one external unit? 3. If the external unit identified by an integer value that corresponds to the I/O unit identified by an asterisk for input or output is closed, does that cause the I/O unit identified by an asterisk to become disconnected? ANSWER: 1. No. 2. No. 3. Yes. DISCUSSION: The submitter states: At least one Fortran 95 implementation uses -1 as the value of the I/O unit identified by an asterisk. A carefully constructed INQUIRE statement can expose this value to the user. Many users expect I/O to the units identified by asterisks to continue to work even after the corresponding units identified by integer values have been closed. 1. There is no requirement in the standard that the asterisk correspond to an external-file-unit; it is, however, permissible. An edit is provided to clarify this. 2. For the units identified by the asterisk, the text of section 9.3.2 does not allow two or more units to be connected simultaneously to the same external device or file [139:8-9]. 3. There might not be an external-file-unit that corresponds to the io-unit specified by an asterisk, as clarified by the edit below. If there is, it is permissible to execute a CLOSE statement on them as on any other unit. Note however that a processor extension may have two units connected to the same file - e.g. unit 6 and the * output unit might both identify the user's display. This is not detectable by a standard-conforming program, but in this case closing unit 6 would not necessarily affect output to the display via *. REFERENCES: ISO/IEC 1539-1:1997(E), Sections 9.3 and 9.4.4.2 EDITS: Add the following text to the end of the last paragraph before section 9.3.1 [138:34+]: "An asterisk used in an input statement may identify the same as a particular . An asterisk used in an output statement may identify the same as another particular ." SUBMITTED BY: Robert Corbett HISTORY: 99-192 m150 Submitted 99-215r1 m150 approved uc 00-208 m153 passed by J3 letter ballot 00-268 m154 Failed WG5 letter ballot (N1395 & N1403) WG5/N1452 Suggested revision (expanded discussion). 158-mjc-012 m158 ----------------------------------------------------------------------