Re: Opening an already-connected unit with status='unknown'

From: Toby White (tow21_at_cam.ac.uk)
Date: 01/07/05


Date: Fri, 07 Jan 2005 19:20:00 +0000

Richard E Maine <nospam@see.signature> writes:

> In article <t8voeg19l08.fsf@parabrisas.esc.cam.ac.uk>,
> Toby White <tow21@cam.ac.uk> wrote:
>
>> open(unit=13,name="file")
>> open(unit=13,name="file",status='unknown')
> ...
>> Should the second open succeed?
>
> Interesting point. I'd say that the standard comes close to
> contradicting itself here, but not quite. Close enough that the point is
> probably arguable.
>
>> (I presume 9.3.4.2 (f95) is the relevant paragraph)
>
> Well, that's one of the 2. And indeed, that makes it sound like leaving
> the status unspecified should be a lot like specifying status='unknown'.
>
> However, see also the 6th para of 9.3.4 in f95. In that para we see
>
> "If the STATUS= specifier is included in such an OPEN statement, it
> shall be specified with a value of OLD."
>
> That seems pretty explicit to me. It doesn't say "OLD or UNKNOWN". Thus
> you can specify OLD or you can omit the STATUS=, but you can't specify
> UNKNOWN.

Ah - I'd missed that paragraph. That's fairly clear, and I assume the
rule which is intended to apply in this case, notwithstanding the
confusion of 9.3.4.2. (Has any of the wording in this changed for F2003?
I have the committee draft from Sep. 2002, and it seems not to have)

Oh well. I shall add that to my list of Fortran arcana.

-- 
Dr. Toby White, Dept. of Earth Sciences, Downing Street, Cambridge CB2 3EQ. UK
Email: <tow21@cam.ac.uk>


Relevant Pages

  • Re: Buffer overflows and asctime()
    ... struct tm members to be within their valid ranges is up to an user of ... There is no valid range for the year as specified in the standard. ... I wouldn't call it a defect, because the existence of a limit beyond which asctime() cannot be safely used is inferable from the description of asctime. ... I would consider it a substantial improvement for the standard to explicitly specify the limit. ...
    (comp.std.c)
  • Re: [fitsbits] Comments on image distortion conventions
    ... The document should specify default values for any coefficients that are absent from the header, but might be expected based upon the value of A_ORDER or B_ORDER. ... Presumably either the values would be taken to be zero or the convention should require that all keywords be present. ... The convention would appear to mis-use the CTYPEi reserved keyword in a way that at least technically violates the FITS standard. ... of including distortion in the pixel world coordinate transformation directly. ...
    (sci.astro.fits)
  • Re: Boolean Buyers Beware ... AIX compiler bug --- PMR 26241,756
    ... But the compiler does have other options for updating byte fields, ... I didn't bring the C++ standard into the discussion, ... C++ doesn't specify anything here, and still one needs multithreading. ...
    (comp.programming.threads)
  • Re: Boolean Buyers Beware ... AIX compiler bug --- PMR 26241,756
    ... IBM identified a source work-around, and claimed the problem was our ... I don't think the C++ standard has a word to say about threads. ... C++ doesn't specify anything here, and still one needs multithreading. ...
    (comp.programming.threads)
  • Meaning of implementation def. behaviour (was: Re: C99 IDE for windows)
    ... International Standard provides two or more possibilities and imposes ... provides all possible courses of action and the implementation is ... how can the Standard specify the output ...
    (comp.lang.c)