Re: closing unit=5 and unit=6 and print *
- From: robert.corbett@xxxxxxx
- Date: 30 Aug 2006 13:21:17 -0700
James Giles wrote:
I don't believe that subtle distinction is strong enough to allow what
DEC, Cray, and now Sun do. Suppose * and 6 (for example) are
two different identifiers for the same unit. Then closing the unit
idenitified by 6 should close the unit idenified by *, and that does
not happen for those implementations. I could weasel-word my
way around that, but if 6 is used to identify a unit in a subsequent
OPEN statement, it does not change the connection for * in those
implementations. I see no way to weasel-word my way around that.
Suppose that * and 6 (for example) were two different identifiers
for a different units both of which (by default) talk to an interactive
terminal. Since that's not a file, there's no violation of the rule
about two units connecting to the same file. So, closing 6 and
reopening it need not change the connection for *.
The Fortran standard has no concept of an interactive terminal.
External units are connected to files, not devices. Previous
versions of the standard did speak of devices with regard to
printing, but even that use has disappeared from the latest
standard.
Now, *if* redirection (say, on a command) were to associate both
identifiers with the same *file* this logic wouldn't apply. Is that what
happens? If so, I'd agree that they were in violation if the same
association between them were not preserved by CLOSE/OPEN
operations on one of them.
However, suppose that redirection changes the connection for *, but
not for 6 (which would still be connected to the terminal). I don't see
that to be a violation. That means that, by default, they are different
units connected to the same *device* (which isn't a file).
Again, there is nothing in the standard about connecting to devices.
In the logical model of I/O used in the standard, there are no devices.
So, if they both *always* stay connected together, I don't see
that as a violation. Or, if they never *change* together, but are
merely both connected to a non-file device by default I don't
see that as a violation.
If the external units identified by * and 6 are always treated as the
same unit or they are always treated as different units, there is no
problem. The DEC/Compaq/HP implementation (I don't know if the
behavior has carried over to Intel's implementation), Cray's
implementation, and Sun's implementation treat the units identified
by one of the uses of * and 6 as if they are the same unit initially,
but as different units if the unit identified by 6 is closed.
Bob Corbett
.
- Follow-Ups:
- Re: closing unit=5 and unit=6 and print *
- From: James Giles
- Re: closing unit=5 and unit=6 and print *
- References:
- closing unit=5 and unit=6 and print *
- From: Dylan Sung
- Re: closing unit=5 and unit=6 and print *
- From: Tim Prince
- Re: closing unit=5 and unit=6 and print *
- From: Richard E Maine
- Re: closing unit=5 and unit=6 and print *
- From: robert . corbett
- Re: closing unit=5 and unit=6 and print *
- From: James Giles
- closing unit=5 and unit=6 and print *
- Prev by Date: Re: problematic array assignment in double precision (ifort, windows)
- Next by Date: best way to use the USE statement
- Previous by thread: Re: closing unit=5 and unit=6 and print *
- Next by thread: Re: closing unit=5 and unit=6 and print *
- Index(es):
Relevant Pages
|