Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Gee, Toto, I don't think we're in Kansas anymore.


devel / comp.lang.fortran / Re: end-of-file IOSTAT / debugging

SubjectAuthor
* end-of-file IOSTAT / debuggingDave Tholen
+* Re: end-of-file IOSTAT / debuggingRobin Vowels
|+* Re: end-of-file IOSTAT / debuggingSteve Lionel
||+- Re: end-of-file IOSTAT / debuggingRobin Vowels
||`- Re: end-of-file IOSTAT / debuggingDave Tholen
|`* Re: end-of-file IOSTAT / debuggingDave Tholen
| `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|  `* Re: end-of-file IOSTAT / debuggingDave Tholen
|   +* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |`* Re: end-of-file IOSTAT / debuggingDave Tholen
|   | `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |  `* Re: end-of-file IOSTAT / debuggingDave Tholen
|   |   `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |    `* Re: end-of-file IOSTAT / debuggingDave Tholen
|   |     +* Re: end-of-file IOSTAT / debuggingLouis Krupp
|   |     |`- Re: end-of-file IOSTAT / debuggingRon Shepard
|   |     +- Re: end-of-file IOSTAT / debuggingThomas Koenig
|   |     +* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |     |+* Re: end-of-file IOSTAT / debuggingRon Shepard
|   |     ||+- Re: end-of-file IOSTAT / debuggingPeter Klausler US
|   |     ||+- Re: end-of-file IOSTAT / debuggingPeter Klausler US
|   |     ||+* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |     |||`* Re: end-of-file IOSTAT / debuggingRon Shepard
|   |     ||| `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |     |||  `* Re: end-of-file IOSTAT / debuggingRon Shepard
|   |     |||   `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |     |||    +- Re: end-of-file IOSTAT / debuggingJohn
|   |     |||    `* Re: end-of-file IOSTAT / debuggingJohn
|   |     |||     `- Re: end-of-file IOSTAT / debugginggah4
|   |     ||`* Re: end-of-file IOSTAT / debugginggah4
|   |     || `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |     ||  `- Re: end-of-file IOSTAT / debuggingRon Shepard
|   |     |+* Re: end-of-file IOSTAT / debuggingSteve Lionel
|   |     ||+* Re: end-of-file IOSTAT / debuggingRobert Corbett
|   |     |||`- Re: end-of-file IOSTAT / debugginggah4
|   |     ||`* Re: end-of-file IOSTAT / debuggingRon Shepard
|   |     || +* Re: end-of-file IOSTAT / debugginggah4
|   |     || |`- Re: end-of-file IOSTAT / debuggingRon Shepard
|   |     || +* Re: end-of-file IOSTAT / debuggingSteve Lionel
|   |     || |`- Re: end-of-file IOSTAT / debuggingRon Shepard
|   |     || `- Re: end-of-file IOSTAT / debuggingGary Scott
|   |     |`* Re: end-of-file IOSTAT / debuggingDave Tholen
|   |     | +- Re: end-of-file IOSTAT / debugginggah4
|   |     | `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |     |  `* Re: end-of-file IOSTAT / debuggingDave Tholen
|   |     |   +* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |     |   |`- Re: end-of-file IOSTAT / debuggingDave Tholen
|   |     |   `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |     |    `* Re: end-of-file IOSTAT / debuggingDave Tholen
|   |     |     `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |     |      `- Re: end-of-file IOSTAT / debuggingDave Tholen
|   |     `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|   |      `- Re: end-of-file IOSTAT / debuggingDave Tholen
|   `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|    `* Re: end-of-file IOSTAT / debuggingDave Tholen
|     +* Re: end-of-file IOSTAT / debuggingFortranFan
|     |`* Re: end-of-file IOSTAT / debuggingDave Tholen
|     | +- Re: end-of-file IOSTAT / debuggingFortranFan
|     | `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|     |  `* Re: end-of-file IOSTAT / debuggingDave Tholen
|     |   +* Re: end-of-file IOSTAT / debuggingRobin Vowels
|     |   |`* Re: end-of-file IOSTAT / debuggingDave Tholen
|     |   | +* Re: end-of-file IOSTAT / debuggingLouis Krupp
|     |   | |`* Re: end-of-file IOSTAT / debuggingDave Tholen
|     |   | | `* Re: end-of-file IOSTAT / debuggingLouis Krupp
|     |   | |  `* Re: end-of-file IOSTAT / debuggingDave Tholen
|     |   | |   `- Re: end-of-file IOSTAT / debuggingLouis Krupp
|     |   | `* Re: debuggingRobin Vowels
|     |   |  `* Re: debuggingDave Tholen
|     |   |   `* Re: debuggingRobin Vowels
|     |   |    `- Re: debuggingDave Tholen
|     |   `- Re: end-of-file IOSTAT / debuggingThomas Koenig
|     `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|      `* Re: end-of-file IOSTAT / debuggingDave Tholen
|       `* Re: end-of-file IOSTAT / debuggingRobin Vowels
|        `- Re: end-of-file IOSTAT / debuggingDave Tholen
+* Re: end-of-file IOSTAT / debuggingsteve kargl
|+* Re: end-of-file IOSTAT / debuggingDave Tholen
||`* Re: end-of-file IOSTAT / debuggingSteve Lionel
|| `- Re: end-of-file IOSTAT / debuggingFortranFan
|`* Re: end-of-file IOSTAT / debuggingLouis Krupp
| `* Re: end-of-file IOSTAT / debuggingDave Tholen
|  +* Re: end-of-file IOSTAT / debuggingFortranFan
|  |`* Re: end-of-file IOSTAT / debuggingRon Shepard
|  | `* Re: end-of-file IOSTAT / debuggingFortranFan
|  |  +- Re: end-of-file IOSTAT / debuggingJohn
|  |  `* Re: end-of-file IOSTAT / debugginggah4
|  |   `- Re: end-of-file IOSTAT / debuggingDick Hendrickson
|  +- Re: end-of-file IOSTAT / debuggingLouis Krupp
|  `- Re: end-of-file IOSTAT / debuggingRobin Vowels
+* Re: end-of-file IOSTAT / debugginggah4
|+- Re: end-of-file IOSTAT / debuggingRobin Vowels
|`- Re: end-of-file IOSTAT / debuggingRobin Vowels
`* Re: end-of-file IOSTAT / debugginggah4
 +- Re: end-of-file IOSTAT / debuggingjfh
 +* Re: end-of-file IOSTAT / debuggingDave Tholen
 |`* Re: end-of-file IOSTAT / debugginggah4
 | `* Re: end-of-file IOSTAT / debuggingRobin Vowels
 |  +* Re: end-of-file IOSTAT / debuggingLouis Krupp
 |  |+* Re: end-of-file IOSTAT / debugginggah4
 |  ||`- Re: end-of-file IOSTAT / debuggingDave Tholen
 |  |`- Re: end-of-file IOSTAT / debuggingDave Tholen
 |  +- Re: end-of-file IOSTAT / debuggingRon Shepard
 |  `- Re: end-of-file IOSTAT / debuggingDave Tholen
 `- Re: end-of-file IOSTAT / debuggingGary Scott

Pages:12345
Re: end-of-file IOSTAT / debugging

<1ba34a18-fd34-45dd-8eb7-9bc9937ecb23n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2617&group=comp.lang.fortran#2617

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:4cd:b0:31f:3234:f474 with SMTP id q13-20020a05622a04cd00b0031f3234f474mr7805185qtx.498.1658765571234;
Mon, 25 Jul 2022 09:12:51 -0700 (PDT)
X-Received: by 2002:a0d:dbc3:0:b0:31d:f1e:7e8e with SMTP id
d186-20020a0ddbc3000000b0031d0f1e7e8emr10545461ywe.180.1658765570980; Mon, 25
Jul 2022 09:12:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Mon, 25 Jul 2022 09:12:50 -0700 (PDT)
In-Reply-To: <MIyDK.568149$ntj.460610@fx15.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=12.154.207.45; posting-account=ZT-cAwoAAACx2tBPXm-WZoHIT8sjnGGy
NNTP-Posting-Host: 12.154.207.45
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1ba34a18-fd34-45dd-8eb7-9bc9937ecb23n@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: pklausler@nvidia.com (Peter Klausler US)
Injection-Date: Mon, 25 Jul 2022 16:12:51 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2565
 by: Peter Klausler US - Mon, 25 Jul 2022 16:12 UTC

12.11.5 IOSTAT= specifier
1 Execution of an input/output statement containing the IOSTAT= specifier causes the stat-variable in the ISTAT= specifier to become defined with
• a zero value if neither an error condition, an end-of-file condition, nor an end-of-record condition occurs,
• the processor-dependent positive integer value of the constant IOSTAT_INQUIRE_INTERNAL_UNIT from the intrinsic module ISO_FORTRAN_ENV (16.10.2) if a unit number in an INQUIRE statement identifies an internal file,
• a processor-dependent positive integer value different from IOSTAT_INQUIRE_INTERNAL_UNIT if any other error condition occurs,
• the processor-dependent negative integer value of the constant IOSTAT_END (16.10.2.16) from the intrinsic module ISO_FORTRAN_ENV if an end-of-file condition occurs and no error condition occurs,

Re: end-of-file IOSTAT / debugging

<ec18acb3-981e-47f3-939e-2c141f5abfe9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2618&group=comp.lang.fortran#2618

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:4442:b0:6b2:844e:ee67 with SMTP id w2-20020a05620a444200b006b2844eee67mr9598053qkp.625.1658766313847;
Mon, 25 Jul 2022 09:25:13 -0700 (PDT)
X-Received: by 2002:a81:69c3:0:b0:31e:8481:21f5 with SMTP id
e186-20020a8169c3000000b0031e848121f5mr10469893ywc.63.1658766313495; Mon, 25
Jul 2022 09:25:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Mon, 25 Jul 2022 09:25:13 -0700 (PDT)
In-Reply-To: <MIyDK.568149$ntj.460610@fx15.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ec18acb3-981e-47f3-939e-2c141f5abfe9n@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Mon, 25 Jul 2022 16:25:13 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2939
 by: Robin Vowels - Mon, 25 Jul 2022 16:25 UTC

On Tuesday, July 26, 2022 at 1:33:04 AM UTC+10, Ron Shepard wrote:
> On 7/25/22 1:03 AM, Robin Vowels wrote:
> > The situation is NOT "processor dependent". The actual numerical value
> > is processor dependent", but the sign of the value is NOT. The sign
> > is required to be positive. ifort is not standard-conforming.
..
> Can you quote the standard, any version of the standard, that specifies
> this?
..
ANSI X3.9-1978 Programming Language FORTRAN.
..
12.7

IOSTAT = ios

where ios is an integer variable or integer array element.

Execution of an input/output statement statement containing
this specifier causes ios to become defined:

(1) with a zero value if neither an error condition nor
an end-of-file condition is encountered by the processor.

(2) with a processor-dependent positive integer value if an
error condition is encountered, or

(3) with a processor-dependent negative integer value if
an end-of-file condition is encountered and no error
condition is encountered.
..
> I do not think it is true for the reasons I explained previously
> in this thread. If this were true, then there would be no way to read
> multiple files from a magnetic tape. Yet at one time, that was a
> routine, everyday, occurrence for fortran programmers.

Re: end-of-file IOSTAT / debugging

<5766c729-5404-4a5d-8779-72f5e23d2813n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2619&group=comp.lang.fortran#2619

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:f0c4:0:b0:474:210a:69fd with SMTP id d4-20020a0cf0c4000000b00474210a69fdmr11151174qvl.4.1658772257883;
Mon, 25 Jul 2022 11:04:17 -0700 (PDT)
X-Received: by 2002:a05:6902:118a:b0:66f:774d:dbf5 with SMTP id
m10-20020a056902118a00b0066f774ddbf5mr10470250ybu.532.1658772257675; Mon, 25
Jul 2022 11:04:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Mon, 25 Jul 2022 11:04:17 -0700 (PDT)
In-Reply-To: <MIyDK.568149$ntj.460610@fx15.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:f0ff:ad8e:e7cc:393;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:f0ff:ad8e:e7cc:393
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5766c729-5404-4a5d-8779-72f5e23d2813n@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: gah4@u.washington.edu (gah4)
Injection-Date: Mon, 25 Jul 2022 18:04:17 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 49
 by: gah4 - Mon, 25 Jul 2022 18:04 UTC

On Monday, July 25, 2022 at 8:33:04 AM UTC-7, Ron Shepard wrote:
> On 7/25/22 1:03 AM, Robin Vowels wrote:
> > The situation is NOT "processor dependent". The actual numerical value
> > is processor dependent", but the sign of the value is NOT. The sign
> > is required to be positive. ifort is not standard-conforming.

> Can you quote the standard, any version of the standard, that specifies
> this? I do not think it is true for the reasons I explained previously
> in this thread. If this were true, then there would be no way to read
> multiple files from a magnetic tape. Yet at one time, that was a
> routine, everyday, occurrence for fortran programmers.

Fortran 66, the version used when tapes were most popular, has no way
to detect EOF or ERR.

The END= and ERR= options, as well as I know, where added to IBM
Fortran IV, as extensions to Fortran 66. (Or maybe earlier, but that didn't
make it into the standard.) IBM is always good at marking the extensions
in their manual with a gray shading.

With OS/360 Fortran compilers, you use a DD statement in JCL for each
tape (or non-tape) file you want to read. It will first read from DDname
FTxxF001, where xx is the unit number. After the EOF exit, continued
reading is from FTxxF002. You can read many different disk data sets,
or sequential (or any order) tape data sets, with appropriate JCL.
For tapes, you need LABEL=(1,SL) for the first file on a standard
labelled tape (where the DSNAME must agree), and LABEL=(2,SL)
for the next one.

Or LABEL=(1,NL) for an unlabelled tape, or LABEL=(1,AL) for an
ANSI labelled tape. The latter worked with VAX, and also did
EBCDIC to/from ASCII translation.

So, the error case occurs when it tries to read a file that isn't
there, after the END= case. As well as I know, the standard
doesn't require that ability, but does allow for it.

Or it could immediately give END= for the (non-existent)
next file.

In any case, when IOSTAT is non-zero, either sign, the
standard makes all variables in the I/O list undefined.
Even the ones that might have been read before the
EOF or ERR condition.

Re: end-of-file IOSTAT / debugging

<jk87dcF2pp5U1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2620&group=comp.lang.fortran#2620

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: steve@seesignature.invalid (Steve Lionel)
Newsgroups: comp.lang.fortran
Subject: Re: end-of-file IOSTAT / debugging
Date: Mon, 25 Jul 2022 14:57:48 -0400
Lines: 32
Message-ID: <jk87dcF2pp5U1@mid.individual.net>
References: <tark4g$5or$1@gioia.aioe.org>
<7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org>
<9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org>
<c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org>
<9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org>
<c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org>
<454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net uZEWhpxc2iKd4NDAxCa1sA8knzcqERPQ+7D/7NcELBOBlIoxxC
Cancel-Lock: sha1:ADGRc+/4P1pFBVw3xQpvkL4UiZ8=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101
Thunderbird/103.0
Content-Language: en-US
In-Reply-To: <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
 by: Steve Lionel - Mon, 25 Jul 2022 18:57 UTC

On 7/25/2022 2:03 AM, Robin Vowels wrote:
>>>>> The closest anyone has come is Steve Lionel, who said he could
>>>>> make an argument for the second instance not being -1, but he didn't
>>>>> present that argument. That ifort returns -1 upon a second READ
>>>>> demonstrates that the situation is "processor dependent".
> The situation is NOT "processor dependent". The actual numerical value
> is processor dependent", but the sign of the value is NOT. The sign
> is required to be positive. ifort is not standard-conforming.
>

I discussed this issue with Malcolm Cohen of NAG last week. He agreed
with me that continuing to read after the "ENDFILE record" has been
passed is an error, and NOT an end-of-file condition, therefore a
positive IOSTAT value is required. ifort is wrong here.

Note that you can BACKSPACE back to before the "ENDFILE record" (which
doesn't have to have a physical manifestation), and then get an endfile
condition again on a subsequent read.

While it was once common practice to read past tapemarks on unlabeled
magnetic tapes, that never became part of the Fortran standard.
--
Steve Lionel
ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn: https://www.linkedin.com/in/stevelionel
Blog: https://stevelionel.com/drfortran
WG5: https://wg5-fortran.org

Re: end-of-file IOSTAT / debugging

<86e4e867-9f8c-4b65-80c5-362ae92c2487n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2621&group=comp.lang.fortran#2621

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:5761:0:b0:473:7861:69d1 with SMTP id r1-20020ad45761000000b00473786169d1mr12443547qvx.73.1658785202169;
Mon, 25 Jul 2022 14:40:02 -0700 (PDT)
X-Received: by 2002:a25:cc4e:0:b0:670:fc6f:f0eb with SMTP id
l75-20020a25cc4e000000b00670fc6ff0ebmr10275571ybf.467.1658785201913; Mon, 25
Jul 2022 14:40:01 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Mon, 25 Jul 2022 14:40:01 -0700 (PDT)
In-Reply-To: <jk87dcF2pp5U1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=108.74.162.237; posting-account=r3eTlQoAAAABvPStTQdpPnri4DjaXXqT
NNTP-Posting-Host: 108.74.162.237
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<jk87dcF2pp5U1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <86e4e867-9f8c-4b65-80c5-362ae92c2487n@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: robertpaulcorbett@gmail.com (Robert Corbett)
Injection-Date: Mon, 25 Jul 2022 21:40:02 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4685
 by: Robert Corbett - Mon, 25 Jul 2022 21:40 UTC

On Monday, July 25, 2022 at 11:57:52 AM UTC-7, Steve Lionel wrote:
> On 7/25/2022 2:03 AM, Robin Vowels wrote:
> >>>>> The closest anyone has come is Steve Lionel, who said he could
> >>>>> make an argument for the second instance not being -1, but he didn't
> >>>>> present that argument. That ifort returns -1 upon a second READ
> >>>>> demonstrates that the situation is "processor dependent".
> > The situation is NOT "processor dependent". The actual numerical value
> > is processor dependent", but the sign of the value is NOT. The sign
> > is required to be positive. ifort is not standard-conforming.
> >
> I discussed this issue with Malcolm Cohen of NAG last week. He agreed
> with me that continuing to read after the "ENDFILE record" has been
> passed is an error, and NOT an end-of-file condition, therefore a
> positive IOSTAT value is required. ifort is wrong here.
>
> Note that you can BACKSPACE back to before the "ENDFILE record" (which
> doesn't have to have a physical manifestation), and then get an endfile
> condition again on a subsequent read.
>
> While it was once common practice to read past tapemarks on unlabeled
> magnetic tapes, that never became part of the Fortran standard.
> --
> Steve Lionel
> ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
> Retired Intel Fortran developer/support
> Email: firstname at firstnamelastname dot com
> Twitter: @DoctorFortran
> LinkedIn: https://www.linkedin.com/in/stevelionel
> Blog: https://stevelionel.com/drfortran
> WG5: https://wg5-fortran.org

I agree with you that attempting to read past the
endfile record of a sequential-access file is an
error, not an end-of-file condition. I do not agree
that it necessarily is an input/output error
condition. Subclause 12.11.1 of the Fortran 2018
standard states

The set of input/output error conditions is
processor dependent. Except as otherwise
specified, when an error condition occurs or
is detected is processor dependent.

Paragraph 2 of subclause 12.3.4.3 states

Input shall not occur if there is no next
record or if there is a current record and
the last data transfer statement accessing
the file performed output.

Nothing in that statement specifies that an
error condition occurs. It only says that a
program that tries to read a record that does
not exist is not a conforming program.

The Fortran standard explicitly does not
specify the behavior of programs that are
not standard conforming (see item 4 in the
list given in paragraph 4 of clause 1).
Therefore, a program that tries to read past
the end of the file could detect an
input/output error condition. It could detect
an end-of-file condition. It could detect an
end-of-record condition. It could read a record
from some other file.

There was once a proposal to codify the set of
input/output error conditions, but the effort did
not last long.

An attempt to read after an end-of-file
condition has occurred leads to unspecified
behavior.

Re: end-of-file IOSTAT / debugging

<b9dc889b-4c46-4546-adf8-a844a5ff33b7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2622&group=comp.lang.fortran#2622

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:f2d0:0:b0:474:e74:f43c with SMTP id c16-20020a0cf2d0000000b004740e74f43cmr12441824qvm.75.1658795016728;
Mon, 25 Jul 2022 17:23:36 -0700 (PDT)
X-Received: by 2002:a25:6a06:0:b0:66f:a81:d865 with SMTP id
f6-20020a256a06000000b0066f0a81d865mr11404397ybc.392.1658795016544; Mon, 25
Jul 2022 17:23:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Mon, 25 Jul 2022 17:23:36 -0700 (PDT)
In-Reply-To: <86e4e867-9f8c-4b65-80c5-362ae92c2487n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:51f4:4bdc:b472:2848;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:51f4:4bdc:b472:2848
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<jk87dcF2pp5U1@mid.individual.net> <86e4e867-9f8c-4b65-80c5-362ae92c2487n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b9dc889b-4c46-4546-adf8-a844a5ff33b7n@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: gah4@u.washington.edu (gah4)
Injection-Date: Tue, 26 Jul 2022 00:23:36 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3530
 by: gah4 - Tue, 26 Jul 2022 00:23 UTC

On Monday, July 25, 2022 at 2:40:03 PM UTC-7, Robert Corbett wrote:
> On Monday, July 25, 2022 at 11:57:52 AM UTC-7, Steve Lionel wrote:

(snip)
> > While it was once common practice to read past tapemarks on unlabeled
> > magnetic tapes, that never became part of the Fortran standard.

(snip)
> I agree with you that attempting to read past the
> endfile record of a sequential-access file is an
> error, not an end-of-file condition. I do not agree
> that it necessarily is an input/output error
> condition. Subclause 12.11.1 of the Fortran 2018
> standard states

(snip)
> Input shall not occur if there is no next
> record or if there is a current record and
> the last data transfer statement accessing
> the file performed output.
> Nothing in that statement specifies that an
> error condition occurs. It only says that a
> program that tries to read a record that does
> not exist is not a conforming program.
> The Fortran standard explicitly does not
> specify the behavior of programs that are
> not standard conforming (see item 4 in the
> list given in paragraph 4 of clause 1).
> Therefore, a program that tries to read past
> the end of the file could detect an
> input/output error condition. It could detect
> an end-of-file condition. It could detect an
> end-of-record condition. It could read a record
> from some other file.
Unix/C allows, and I presume is part of POSIX,
for a program to continue reading in case a file
size increases.

Specifically, that is used by the "tail -f" command
to follow writing to a file.

That is complicated by systems that do file locking,
but it works fine with Unix.

I am not so sure about the connection between
Fortran and POSIX.

Re: end-of-file IOSTAT / debugging

<4kNDK.448407$vAW9.33672@fx10.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2623&group=comp.lang.fortran#2623

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx10.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.0.3
Subject: Re: end-of-file IOSTAT / debugging
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <tark4g$5or$1@gioia.aioe.org>
<7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org>
<9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org>
<c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org>
<9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org>
<c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org>
<454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<jk87dcF2pp5U1@mid.individual.net>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <jk87dcF2pp5U1@mid.individual.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 15
Message-ID: <4kNDK.448407$vAW9.33672@fx10.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 26 Jul 2022 03:10:40 -0500
X-Received-Bytes: 2098
 by: Ron Shepard - Tue, 26 Jul 2022 08:10 UTC

On 7/25/22 1:57 PM, Steve Lionel wrote:
> While it was once common practice to read past tapemarks on unlabeled
> magnetic tapes, that never became part of the Fortran standard.

I agree that fortran does not require this behavior, but I think the
current question is asking the other way. Did any Fortran standard ever
forbid it from occurring? I don't think it did, I think it left it as
processor dependent to first detect it as an error, and second which
positive error code to report if it was detected as an error. Doing this
makes sense for some devices, like magnetic tapes with multiple files,
or card decks with end-of-deck cards interspersed, but not others, like
a disk file system.

$.02 -Ron Shepard

Re: end-of-file IOSTAT / debugging

<buNDK.448408$vAW9.182788@fx10.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2624&group=comp.lang.fortran#2624

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx10.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.0.3
Subject: Re: end-of-file IOSTAT / debugging
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <tark4g$5or$1@gioia.aioe.org>
<7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org>
<9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org>
<c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org>
<9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org>
<c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org>
<454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad>
<ec18acb3-981e-47f3-939e-2c141f5abfe9n@googlegroups.com>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <ec18acb3-981e-47f3-939e-2c141f5abfe9n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 33
Message-ID: <buNDK.448408$vAW9.182788@fx10.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 26 Jul 2022 03:21:27 -0500
X-Received-Bytes: 2646
 by: Ron Shepard - Tue, 26 Jul 2022 08:21 UTC

On 7/25/22 11:25 AM, Robin Vowels wrote:
> On Tuesday, July 26, 2022 at 1:33:04 AM UTC+10, Ron Shepard wrote:
>> On 7/25/22 1:03 AM, Robin Vowels wrote:
>>> The situation is NOT "processor dependent". The actual numerical value
>>> is processor dependent", but the sign of the value is NOT. The sign
>>> is required to be positive. ifort is not standard-conforming.
> .
>> Can you quote the standard, any version of the standard, that specifies
>> this?
> .
> ANSI X3.9-1978 Programming Language FORTRAN.
> .
> 12.7
>
> IOSTAT = ios
>
> where ios is an integer variable or integer array element.
>
> Execution of an input/output statement statement containing
> this specifier causes ios to become defined:
>
> (1) with a zero value if neither an error condition nor
> an end-of-file condition is encountered by the processor.
>
> (2) with a processor-dependent positive integer value if an
> error condition is encountered, or

This only occurs "if an error condition is encountered". The f77
standard does not specify that reading past an EOF marker is an error
condition. Neither does it specify that it is not an error condition.

$.02 -Ron Shepard

Re: end-of-file IOSTAT / debugging

<b3165dad-bc55-4a78-8611-33dcd5f1473bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2625&group=comp.lang.fortran#2625

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:c62:b0:474:3b6f:cb6 with SMTP id t2-20020a0562140c6200b004743b6f0cb6mr10900505qvj.126.1658831362763;
Tue, 26 Jul 2022 03:29:22 -0700 (PDT)
X-Received: by 2002:a81:5d06:0:b0:31e:3b24:4a86 with SMTP id
r6-20020a815d06000000b0031e3b244a86mr13260076ywb.245.1658831362583; Tue, 26
Jul 2022 03:29:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 26 Jul 2022 03:29:22 -0700 (PDT)
In-Reply-To: <buNDK.448408$vAW9.182788@fx10.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad> <ec18acb3-981e-47f3-939e-2c141f5abfe9n@googlegroups.com>
<buNDK.448408$vAW9.182788@fx10.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b3165dad-bc55-4a78-8611-33dcd5f1473bn@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Tue, 26 Jul 2022 10:29:22 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3273
 by: Robin Vowels - Tue, 26 Jul 2022 10:29 UTC

On Tuesday, July 26, 2022 at 6:21:31 PM UTC+10, Ron Shepard wrote:
> On 7/25/22 11:25 AM, Robin Vowels wrote:
> > On Tuesday, July 26, 2022 at 1:33:04 AM UTC+10, Ron Shepard wrote:
> >> On 7/25/22 1:03 AM, Robin Vowels wrote:
> >>> The situation is NOT "processor dependent". The actual numerical value
> >>> is processor dependent", but the sign of the value is NOT. The sign
> >>> is required to be positive. ifort is not standard-conforming.
> > .
> >> Can you quote the standard, any version of the standard, that specifies
> >> this?
> > .
> > ANSI X3.9-1978 Programming Language FORTRAN.
> > .
> > 12.7
> >
> > IOSTAT = ios
> >
> > where ios is an integer variable or integer array element.
> >
> > Execution of an input/output statement statement containing
> > this specifier causes ios to become defined:
> >
> > (1) with a zero value if neither an error condition nor
> > an end-of-file condition is encountered by the processor.
> >
> > (2) with a processor-dependent positive integer value if an
> > error condition is encountered, or
..
> This only occurs "if an error condition is encountered". The f77
> standard does not specify that reading past an EOF marker is an error
> condition. Neither does it specify that it is not an error condition.
..
The F77 and subsequent standards specify two kinds of things:
1. an end-of-file condition;
2. an error condition.
If the event is not an end-of-file condition, it is therefore an error condition.
It is clear and unequivocal.

Re: end-of-file IOSTAT / debugging

<9e6216e6-8ea1-40c6-813f-93d506f6d2acn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2626&group=comp.lang.fortran#2626

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:1646:b0:31e:fec2:d1d5 with SMTP id y6-20020a05622a164600b0031efec2d1d5mr13804807qtj.213.1658831788828;
Tue, 26 Jul 2022 03:36:28 -0700 (PDT)
X-Received: by 2002:a81:8841:0:b0:31d:a90f:73e2 with SMTP id
y62-20020a818841000000b0031da90f73e2mr13790282ywf.54.1658831788626; Tue, 26
Jul 2022 03:36:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 26 Jul 2022 03:36:28 -0700 (PDT)
In-Reply-To: <5766c729-5404-4a5d-8779-72f5e23d2813n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad> <5766c729-5404-4a5d-8779-72f5e23d2813n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9e6216e6-8ea1-40c6-813f-93d506f6d2acn@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Tue, 26 Jul 2022 10:36:28 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3678
 by: Robin Vowels - Tue, 26 Jul 2022 10:36 UTC

On Tuesday, July 26, 2022 at 4:04:19 AM UTC+10, gah4 wrote:
..
> Fortran 66, the version used when tapes were most popular, has no way
> to detect EOF or ERR.
>
> The END= and ERR= options, as well as I know, where added to IBM
> Fortran IV, as extensions to Fortran 66. (Or maybe earlier, but that didn't
> make it into the standard.) IBM is always good at marking the extensions
> in their manual with a gray shading.

A good reason for using PL/I which, in 1966, treated routinely
end-of-file conditions [ ON ENDFILE (x) ... ] and error conditions
[ ON ERROR ... ]

> With OS/360 Fortran compilers, you use a DD statement in JCL for each
> tape (or non-tape) file you want to read. It will first read from DDname
> FTxxF001, where xx is the unit number. After the EOF exit, continued
> reading is from FTxxF002. You can read many different disk data sets,
> or sequential (or any order) tape data sets, with appropriate JCL.
> For tapes, you need LABEL=(1,SL) for the first file on a standard
> labelled tape (where the DSNAME must agree), and LABEL=(2,SL)
> for the next one.
>
> Or LABEL=(1,NL) for an unlabelled tape, or LABEL=(1,AL) for an
> ANSI labelled tape. The latter worked with VAX, and also did
> EBCDIC to/from ASCII translation.
>
> So, the error case occurs when it tries to read a file that isn't
> there, after the END= case. As well as I know, the standard
> doesn't require that ability, but does allow for it.
>
> Or it could immediately give END= for the (non-existent)
> next file.
>
> In any case, when IOSTAT is non-zero, either sign, the
> standard makes all variables in the I/O list undefined.
> Even the ones that might have been read before the
> EOF or ERR condition.
..
Another reason for using PL/I, in which variables already read
were stored, and the values of which were available.
..
FORTRAN did not have any of those facilities until more
than a decade later.

Re: end-of-file IOSTAT / debugging

<4cf2f4ad-9542-47f5-ba1d-6bc6282a6172n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2627&group=comp.lang.fortran#2627

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:5e85:0:b0:474:2376:ae23 with SMTP id jl5-20020ad45e85000000b004742376ae23mr14694066qvb.94.1658837038491;
Tue, 26 Jul 2022 05:03:58 -0700 (PDT)
X-Received: by 2002:a81:3602:0:b0:31e:722a:65fd with SMTP id
d2-20020a813602000000b0031e722a65fdmr14848213ywa.457.1658837036605; Tue, 26
Jul 2022 05:03:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 26 Jul 2022 05:03:56 -0700 (PDT)
In-Reply-To: <4kNDK.448407$vAW9.33672@fx10.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:950a:fd7e:96b5:222e;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:950a:fd7e:96b5:222e
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<jk87dcF2pp5U1@mid.individual.net> <4kNDK.448407$vAW9.33672@fx10.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4cf2f4ad-9542-47f5-ba1d-6bc6282a6172n@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: gah4@u.washington.edu (gah4)
Injection-Date: Tue, 26 Jul 2022 12:03:58 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2733
 by: gah4 - Tue, 26 Jul 2022 12:03 UTC

On Tuesday, July 26, 2022 at 1:10:44 AM UTC-7, Ron Shepard wrote:
> On 7/25/22 1:57 PM, Steve Lionel wrote:
> > While it was once common practice to read past tapemarks on unlabeled
> > magnetic tapes, that never became part of the Fortran standard.

> I agree that fortran does not require this behavior, but I think the
> current question is asking the other way. Did any Fortran standard ever
> forbid it from occurring? I don't think it did, I think it left it as
> processor dependent to first detect it as an error, and second which
> positive error code to report if it was detected as an error. Doing this
> makes sense for some devices, like magnetic tapes with multiple files,
> or card decks with end-of-deck cards interspersed, but not others, like
> a disk file system.
As I note, with OS/360 Fortran you can have a different disk dataset
to be read after each EOF, with a different DD card. It did always
seem a strange system, as reading sequential files on a tape
seems more obvious.

Re: end-of-file IOSTAT / debugging

<jka3hlFethjU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2628&group=comp.lang.fortran#2628

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: steve@seesignature.invalid (Steve Lionel)
Newsgroups: comp.lang.fortran
Subject: Re: end-of-file IOSTAT / debugging
Date: Tue, 26 Jul 2022 08:04:04 -0400
Lines: 27
Message-ID: <jka3hlFethjU1@mid.individual.net>
References: <tark4g$5or$1@gioia.aioe.org>
<7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org>
<9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org>
<c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org>
<9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org>
<c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org>
<454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<jk87dcF2pp5U1@mid.individual.net> <4kNDK.448407$vAW9.33672@fx10.iad>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net oOMWFpCozXQr/z3B5pmnHAp/HWPUUNv3RM9rhpuEMKMubcyfUQ
Cancel-Lock: sha1:S6+TflsI5l3rg/PzmuaxDOzHt6w=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101
Thunderbird/103.0
Content-Language: en-US
In-Reply-To: <4kNDK.448407$vAW9.33672@fx10.iad>
 by: Steve Lionel - Tue, 26 Jul 2022 12:04 UTC

On 7/26/2022 4:10 AM, Ron Shepard wrote:
> On 7/25/22 1:57 PM, Steve Lionel wrote:
>> While it was once common practice to read past tapemarks on unlabeled
>> magnetic tapes, that never became part of the Fortran standard.
>
> I agree that fortran does not require this behavior, but I think the
> current question is asking the other way. Did any Fortran standard ever
> forbid it from occurring?

The Fortran standard isn't written that way - it describes a
standard-conforming program and what such a program is supposed to do. A
program that is written or behaves in a manner not specified by the
standard is non-conforming and its behavior is processor-dependent.

MIL-STD-1753 did specify that a read after EOF was permissible, but that
aspect never made it into the Fortran standard.
--
Steve Lionel
ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn: https://www.linkedin.com/in/stevelionel
Blog: https://stevelionel.com/drfortran
WG5: https://wg5-fortran.org

Re: end-of-file IOSTAT / debugging

<yQTDK.678194$JVi.244557@fx17.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2629&group=comp.lang.fortran#2629

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.0.3
Subject: Re: end-of-file IOSTAT / debugging
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <tark4g$5or$1@gioia.aioe.org>
<7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org>
<9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org>
<c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org>
<9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org>
<c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org>
<454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad>
<ec18acb3-981e-47f3-939e-2c141f5abfe9n@googlegroups.com>
<buNDK.448408$vAW9.182788@fx10.iad>
<b3165dad-bc55-4a78-8611-33dcd5f1473bn@googlegroups.com>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <b3165dad-bc55-4a78-8611-33dcd5f1473bn@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 29
Message-ID: <yQTDK.678194$JVi.244557@fx17.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 26 Jul 2022 10:34:54 -0500
X-Received-Bytes: 2783
 by: Ron Shepard - Tue, 26 Jul 2022 15:34 UTC

On 7/26/22 5:29 AM, Robin Vowels wrote:
> On Tuesday, July 26, 2022 at 6:21:31 PM UTC+10, Ron Shepard wrote:
[...]
>>> Execution of an input/output statement statement containing
>>> this specifier causes ios to become defined:
>>>
>>> (1) with a zero value if neither an error condition nor
>>> an end-of-file condition is encountered by the processor.
>>>
>>> (2) with a processor-dependent positive integer value if an
>>> error condition is encountered, or
> .
>> This only occurs "if an error condition is encountered". The f77
>> standard does not specify that reading past an EOF marker is an error
>> condition. Neither does it specify that it is not an error condition.
> .
> The F77 and subsequent standards specify two kinds of things:
> 1. an end-of-file condition;
> 2. an error condition.
> If the event is not an end-of-file condition, it is therefore an error condition.
> It is clear and unequivocal.

Show in the text where these are the only two choices when an end of
file is encountered. I don't think it does, I think it leaves it
unspecified, and I think it did so purposefully in order to allow, but
not require, reading more than one file from a tape, card deck, etc.

$.02 -Ron Shepard

Re: end-of-file IOSTAT / debugging

<XUTDK.678195$JVi.208682@fx17.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2630&group=comp.lang.fortran#2630

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.0.3
Subject: Re: end-of-file IOSTAT / debugging
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <tark4g$5or$1@gioia.aioe.org>
<7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org>
<9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org>
<c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org>
<9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org>
<c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org>
<454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad>
<5766c729-5404-4a5d-8779-72f5e23d2813n@googlegroups.com>
<9e6216e6-8ea1-40c6-813f-93d506f6d2acn@googlegroups.com>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <9e6216e6-8ea1-40c6-813f-93d506f6d2acn@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 14
Message-ID: <XUTDK.678195$JVi.208682@fx17.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 26 Jul 2022 10:39:35 -0500
X-Received-Bytes: 1967
 by: Ron Shepard - Tue, 26 Jul 2022 15:39 UTC

On 7/26/22 5:36 AM, Robin Vowels wrote:
[...]

> A good reason for using PL/I which, in 1966, treated routinely
> end-of-file conditions [ ON ENDFILE (x) ... ] and error conditions
> [ ON ERROR ... ]

Just out of curiosity, would PL/I allow a programmer to read multiple
files from a magnetic tape. separated by end-of-file records, or to read
multiple files from a card deck that had end-of-deck cards interspersed
in the stack?

$.02 -Ron Shepard

Re: end-of-file IOSTAT / debugging

<A4UDK.678196$JVi.674312@fx17.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2631&group=comp.lang.fortran#2631

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.0.3
Subject: Re: end-of-file IOSTAT / debugging
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <tark4g$5or$1@gioia.aioe.org>
<7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org>
<9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org>
<c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org>
<9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org>
<c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org>
<454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<jk87dcF2pp5U1@mid.individual.net> <4kNDK.448407$vAW9.33672@fx10.iad>
<4cf2f4ad-9542-47f5-ba1d-6bc6282a6172n@googlegroups.com>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <4cf2f4ad-9542-47f5-ba1d-6bc6282a6172n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 36
Message-ID: <A4UDK.678196$JVi.674312@fx17.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 26 Jul 2022 10:52:00 -0500
X-Received-Bytes: 3336
 by: Ron Shepard - Tue, 26 Jul 2022 15:52 UTC

On 7/26/22 7:03 AM, gah4 wrote:
> On Tuesday, July 26, 2022 at 1:10:44 AM UTC-7, Ron Shepard wrote:
>> On 7/25/22 1:57 PM, Steve Lionel wrote:
>>> While it was once common practice to read past tapemarks on unlabeled
>>> magnetic tapes, that never became part of the Fortran standard.
>
>> I agree that fortran does not require this behavior, but I think the
>> current question is asking the other way. Did any Fortran standard ever
>> forbid it from occurring? I don't think it did, I think it left it as
>> processor dependent to first detect it as an error, and second which
>> positive error code to report if it was detected as an error. Doing this
>> makes sense for some devices, like magnetic tapes with multiple files,
>> or card decks with end-of-deck cards interspersed, but not others, like
>> a disk file system.
>
> As I note, with OS/360 Fortran you can have a different disk dataset
> to be read after each EOF, with a different DD card. It did always
> seem a strange system, as reading sequential files on a tape
> seems more obvious.

Yes, I agree, I was too generous with that example, I should have said
that "some disk file systems" do not allow it.

Regarding unix/POSIX disk file systems, it is required that utilities
like "tail -f" and "more" should be able to read files that are in the
process of being written. Those files do not really have an end-of-file
record, the end is determined by a file system parameter. When the file
pointer reaches that value, the utility sleeps and then wakes up and
checks again to see if more data has been written. So the underlying
model is different from a series of files written to magnetic tape. I'm
not certain, but I don't think "tail -f" or "more" would be required to
work that way on an actual magnetic tape device.

$.02 -Ron Shepard

Re: end-of-file IOSTAT / debugging

<tbp2kf$225c3$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2632&group=comp.lang.fortran#2632

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: garylscott@sbcglobal.net (Gary Scott)
Newsgroups: comp.lang.fortran
Subject: Re: end-of-file IOSTAT / debugging
Date: Tue, 26 Jul 2022 10:52:47 -0500
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <tbp2kf$225c3$1@dont-email.me>
References: <tark4g$5or$1@gioia.aioe.org>
<7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org>
<9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org>
<c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org>
<9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org>
<c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org>
<454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<jk87dcF2pp5U1@mid.individual.net> <4kNDK.448407$vAW9.33672@fx10.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Jul 2022 15:52:48 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="f543e7bd94aa7ffb02e42606cdc2f754";
logging-data="2168195"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5FIj/s+zvtKxlK/o+9k+v6o1jYp/v6PY="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:t61mXXBDBVxXjtEILwhdOaDdKgk=
Content-Language: en-US
In-Reply-To: <4kNDK.448407$vAW9.33672@fx10.iad>
 by: Gary Scott - Tue, 26 Jul 2022 15:52 UTC

On 7/26/2022 3:10 AM, Ron Shepard wrote:
> On 7/25/22 1:57 PM, Steve Lionel wrote:
>> While it was once common practice to read past tapemarks on unlabeled
>> magnetic tapes, that never became part of the Fortran standard.
>
> I agree that fortran does not require this behavior, but I think the
> current question is asking the other way. Did any Fortran standard ever
> forbid it from occurring? I don't think it did, I think it left it as
> processor dependent to first detect it as an error, and second which
> positive error code to report if it was detected as an error. Doing this
> makes sense for some devices, like magnetic tapes with multiple files,
> or card decks with end-of-deck cards interspersed, but not others, like
> a disk file system.
>

Some OS' of the past supported multiple files on disk as well and
returned EOF followed by EOT for disk files with only one file.

> $.02 -Ron Shepard
>

Re: end-of-file IOSTAT / debugging

<GaUDK.678197$JVi.53007@fx17.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2633&group=comp.lang.fortran#2633

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.0.3
Subject: Re: end-of-file IOSTAT / debugging
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <tark4g$5or$1@gioia.aioe.org>
<7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org>
<9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org>
<c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org>
<9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org>
<c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org>
<454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<jk87dcF2pp5U1@mid.individual.net> <4kNDK.448407$vAW9.33672@fx10.iad>
<jka3hlFethjU1@mid.individual.net>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <jka3hlFethjU1@mid.individual.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 28
Message-ID: <GaUDK.678197$JVi.53007@fx17.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 26 Jul 2022 10:58:30 -0500
X-Received-Bytes: 2840
 by: Ron Shepard - Tue, 26 Jul 2022 15:58 UTC

On 7/26/22 7:04 AM, Steve Lionel wrote:
> On 7/26/2022 4:10 AM, Ron Shepard wrote:
>> On 7/25/22 1:57 PM, Steve Lionel wrote:
>>> While it was once common practice to read past tapemarks on unlabeled
>>> magnetic tapes, that never became part of the Fortran standard.
>>
>> I agree that fortran does not require this behavior, but I think the
>> current question is asking the other way. Did any Fortran standard
>> ever forbid it from occurring?
>
> The Fortran standard isn't written that way - it describes a
> standard-conforming program and what such a program is supposed to do. A
> program that is written or behaves in a manner not specified by the
> standard is non-conforming and its behavior is processor-dependent.
>
> MIL-STD-1753 did specify that a read after EOF was permissible, but that
> aspect never made it into the Fortran standard.

This is the sometimes subtle distinction between a nonconforming program
that violates some aspect of the standard and one that is rather
unspecified by the standard. My question regarding reading past an end
of file marker was exactly that point. I think the fortran standard (in
contrast to the MIL-STD standard) never specified that behavior one way
or the other. Others in this discussion are claiming that it was
specifically forbidden and that positive IOSTAT values must be returned.

$.02 -Ron Shepard

Re: end-of-file IOSTAT / debugging

<94cba76d-7f3a-4431-92e7-3bdd494d21fan@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2634&group=comp.lang.fortran#2634

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:7fcd:0:b0:31f:393a:7320 with SMTP id b13-20020ac87fcd000000b0031f393a7320mr7784167qtk.11.1658854267859;
Tue, 26 Jul 2022 09:51:07 -0700 (PDT)
X-Received: by 2002:a05:6902:10ca:b0:671:3616:9147 with SMTP id
w10-20020a05690210ca00b0067136169147mr8643664ybu.105.1658854267634; Tue, 26
Jul 2022 09:51:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 26 Jul 2022 09:51:07 -0700 (PDT)
In-Reply-To: <yQTDK.678194$JVi.244557@fx17.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad> <ec18acb3-981e-47f3-939e-2c141f5abfe9n@googlegroups.com>
<buNDK.448408$vAW9.182788@fx10.iad> <b3165dad-bc55-4a78-8611-33dcd5f1473bn@googlegroups.com>
<yQTDK.678194$JVi.244557@fx17.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <94cba76d-7f3a-4431-92e7-3bdd494d21fan@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Tue, 26 Jul 2022 16:51:07 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3265
 by: Robin Vowels - Tue, 26 Jul 2022 16:51 UTC

On Wednesday, July 27, 2022 at 1:34:58 AM UTC+10, Ron Shepard wrote:
> On 7/26/22 5:29 AM, Robin Vowels wrote:
> > On Tuesday, July 26, 2022 at 6:21:31 PM UTC+10, Ron Shepard wrote:
> [...]
> >>> Execution of an input/output statement statement containing
> >>> this specifier causes ios to become defined:
> >>>
> >>> (1) with a zero value if neither an error condition nor
> >>> an end-of-file condition is encountered by the processor.
> >>>
> >>> (2) with a processor-dependent positive integer value if an
> >>> error condition is encountered, or
> > .
> >> This only occurs "if an error condition is encountered". The f77
> >> standard does not specify that reading past an EOF marker is an error
> >> condition. Neither does it specify that it is not an error condition.
> > .
> > The F77 and subsequent standards specify two kinds of things:
> > 1. an end-of-file condition;
> > 2. an error condition.
> > If the event is not an end-of-file condition, it is therefore an error condition.
> > It is clear and unequivocal.
..
> Show in the text where these are the only two choices when an end of
> file is encountered. I don't think it does, I think it leaves it
> unspecified, and I think it did so purposefully in order to allow, but
> not require, reading more than one file from a tape, card deck, etc.
..
I already have. See my earlier post where the three alternatives are
enunciated.

Re: end-of-file IOSTAT / debugging

<1843ed4e-e478-4182-8317-2d98e2431a95n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2655&group=comp.lang.fortran#2655

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:44c3:b0:6b5:fb6b:d6c9 with SMTP id y3-20020a05620a44c300b006b5fb6bd6c9mr6967711qkp.537.1659218440227;
Sat, 30 Jul 2022 15:00:40 -0700 (PDT)
X-Received: by 2002:a81:5d06:0:b0:31e:3b24:4a86 with SMTP id
r6-20020a815d06000000b0031e3b244a86mr7891603ywb.245.1659218440014; Sat, 30
Jul 2022 15:00:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 30 Jul 2022 15:00:39 -0700 (PDT)
In-Reply-To: <94cba76d-7f3a-4431-92e7-3bdd494d21fan@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:546:300:4c20:9437:315b:8c3b:6d2d;
posting-account=7tVJUQoAAACymEG6aShD5R0lhHCm_A0r
NNTP-Posting-Host: 2601:546:300:4c20:9437:315b:8c3b:6d2d
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad> <ec18acb3-981e-47f3-939e-2c141f5abfe9n@googlegroups.com>
<buNDK.448408$vAW9.182788@fx10.iad> <b3165dad-bc55-4a78-8611-33dcd5f1473bn@googlegroups.com>
<yQTDK.678194$JVi.244557@fx17.iad> <94cba76d-7f3a-4431-92e7-3bdd494d21fan@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1843ed4e-e478-4182-8317-2d98e2431a95n@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: urbanjost@comcast.net (John)
Injection-Date: Sat, 30 Jul 2022 22:00:40 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3513
 by: John - Sat, 30 Jul 2022 22:00 UTC

On Tuesday, July 26, 2022 at 12:51:09 PM UTC-4, Robin Vowels wrote:
> On Wednesday, July 27, 2022 at 1:34:58 AM UTC+10, Ron Shepard wrote:
> > On 7/26/22 5:29 AM, Robin Vowels wrote:
> > > On Tuesday, July 26, 2022 at 6:21:31 PM UTC+10, Ron Shepard wrote:
> > [...]
> > >>> Execution of an input/output statement statement containing
> > >>> this specifier causes ios to become defined:
> > >>>
> > >>> (1) with a zero value if neither an error condition nor
> > >>> an end-of-file condition is encountered by the processor.
> > >>>
> > >>> (2) with a processor-dependent positive integer value if an
> > >>> error condition is encountered, or
> > > .
> > >> This only occurs "if an error condition is encountered". The f77
> > >> standard does not specify that reading past an EOF marker is an error
> > >> condition. Neither does it specify that it is not an error condition.
> > > .
> > > The F77 and subsequent standards specify two kinds of things:
> > > 1. an end-of-file condition;
> > > 2. an error condition.
> > > If the event is not an end-of-file condition, it is therefore an error condition.
> > > It is clear and unequivocal.
> .
> > Show in the text where these are the only two choices when an end of
> > file is encountered. I don't think it does, I think it leaves it
> > unspecified, and I think it did so purposefully in order to allow, but
> > not require, reading more than one file from a tape, card deck, etc.
> .
> I already have. See my earlier post where the three alternatives are
> enunciated.

Re: end-of-file IOSTAT / debugging

<5931b460-a6b5-4f96-b9e8-b239bbe7933fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2656&group=comp.lang.fortran#2656

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:4103:b0:6b6:e86:a8cf with SMTP id j3-20020a05620a410300b006b60e86a8cfmr7468686qko.194.1659219578495;
Sat, 30 Jul 2022 15:19:38 -0700 (PDT)
X-Received: by 2002:a05:6902:124e:b0:668:222c:e8da with SMTP id
t14-20020a056902124e00b00668222ce8damr6601376ybu.383.1659219578350; Sat, 30
Jul 2022 15:19:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 30 Jul 2022 15:19:38 -0700 (PDT)
In-Reply-To: <94cba76d-7f3a-4431-92e7-3bdd494d21fan@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:546:300:4c20:9437:315b:8c3b:6d2d;
posting-account=7tVJUQoAAACymEG6aShD5R0lhHCm_A0r
NNTP-Posting-Host: 2601:546:300:4c20:9437:315b:8c3b:6d2d
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad> <ec18acb3-981e-47f3-939e-2c141f5abfe9n@googlegroups.com>
<buNDK.448408$vAW9.182788@fx10.iad> <b3165dad-bc55-4a78-8611-33dcd5f1473bn@googlegroups.com>
<yQTDK.678194$JVi.244557@fx17.iad> <94cba76d-7f3a-4431-92e7-3bdd494d21fan@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5931b460-a6b5-4f96-b9e8-b239bbe7933fn@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: urbanjost@comcast.net (John)
Injection-Date: Sat, 30 Jul 2022 22:19:38 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3536
 by: John - Sat, 30 Jul 2022 22:19 UTC

A number of environments support multi-file formats MSWindows uses ctrl-Z (the EOF character). in formatted files as a file separator and lets you continue reading, gfortran does not appear to allow you to read past the ctrl-Z. Note that in cygwin the ctrl-Z is not recognized as an EOF by gfortran; but ifort appears to recoginize it as a file separator on Linux platforms (on all platforms?) as an EOF with the ability to ontinue on. I have found the inconsistency to be an issue, and had to use the ISO_C_Binding interface to use the C routines to get consist behavior when trying to "follow" a file being written to be other processes and for reliably reading from FIFO files (although some compilers did just what I wanted at the time). I never filed bug reports on these as they seemed specifically avoided by the standard , allowing the behavior to be processor dependent. Does anything think it should be forbidden to read a multi-file file as formatted I/o (which appears to be the case with gfortran, which does not seem to allow additional I/O ; but maybe it does if a backspace is used (?)). Or is the desire to be able to read further, either because you are readina a multi-file file (definitely a system=dependent creature) or a file still being updated by another process? Regardless of the error messages what are the capabilities missing that you need? I find not being able to read binary streams or pipes from stdin in a standard format FAR more irritating myself.

Re: end-of-file IOSTAT / debugging

<575294c8-2d49-41cd-b688-4ab7009273a0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2657&group=comp.lang.fortran#2657

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:5f06:0:b0:474:335:f9be with SMTP id fo6-20020ad45f06000000b004740335f9bemr9138327qvb.25.1659244661110;
Sat, 30 Jul 2022 22:17:41 -0700 (PDT)
X-Received: by 2002:a81:69c3:0:b0:31e:8481:21f5 with SMTP id
e186-20020a8169c3000000b0031e848121f5mr8371523ywc.63.1659244660781; Sat, 30
Jul 2022 22:17:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 30 Jul 2022 22:17:40 -0700 (PDT)
In-Reply-To: <5931b460-a6b5-4f96-b9e8-b239bbe7933fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:4967:fce:bead:f2a5;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:4967:fce:bead:f2a5
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<MIyDK.568149$ntj.460610@fx15.iad> <ec18acb3-981e-47f3-939e-2c141f5abfe9n@googlegroups.com>
<buNDK.448408$vAW9.182788@fx10.iad> <b3165dad-bc55-4a78-8611-33dcd5f1473bn@googlegroups.com>
<yQTDK.678194$JVi.244557@fx17.iad> <94cba76d-7f3a-4431-92e7-3bdd494d21fan@googlegroups.com>
<5931b460-a6b5-4f96-b9e8-b239bbe7933fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <575294c8-2d49-41cd-b688-4ab7009273a0n@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: gah4@u.washington.edu (gah4)
Injection-Date: Sun, 31 Jul 2022 05:17:41 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2758
 by: gah4 - Sun, 31 Jul 2022 05:17 UTC

On Saturday, July 30, 2022 at 3:19:39 PM UTC-7, John wrote:
> A number of environments support multi-file formats MSWindows uses ctrl-Z (the EOF character).

The ctrl-Z EOF character is from CP/M days, and for some reason is still around.

The CP/M file system only keeps track of how many blocks are in a file.
For text files, there is ctrl-Z at the end, so it knows the exact end.

For not very good reasons, this lasted into MS-DOS, even though it does keep
track of file length in bytes.

In MS-DOS 3.2 days, I used to do bitmap image printing on EPSON and HP
printers, which means printing non-ASCII data. The MS-DOS print spooler
would end on ctrl-Z, so I had to keep those out of the file. A few other
characters it would do funny things with.

Re: end-of-file IOSTAT / debugging

<td77kf$g3h$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2680&group=comp.lang.fortran#2680

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!iayahv1glVWjKlPuzXRjog.user.46.165.242.91.POSTED!not-for-mail
From: tholen@antispam.ham (Dave Tholen)
Newsgroups: comp.lang.fortran
Subject: Re: end-of-file IOSTAT / debugging
Date: Fri, 12 Aug 2022 18:00:15 -1000
Organization: Aioe.org NNTP Server
Message-ID: <td77kf$g3h$1@gioia.aioe.org>
References: <tark4g$5or$1@gioia.aioe.org>
<7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org>
<9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org>
<c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org>
<9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org>
<c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org>
<454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="16497"; posting-host="iayahv1glVWjKlPuzXRjog.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dave Tholen - Sat, 13 Aug 2022 04:00 UTC

>>>>>> If you read (sequentially) past the end-of-file, gfortran sets the value
>>>>>> of IOSTAT to -1, but if you read a second time, gfortran sets the value
>>>>>> of IOSTAT to 5001. I discovered this situation after having written a
>>>>>> program expecting subsequent READs to all return a negative number, and
>>>>>> of course the program didn't behave as expected until I investigated the
>>>>>> problem. So I'm curious as to why the choice was made to have IOSTAT
>>>>>> set to something other than -1 on any READ attempt after the end-of-file
>>>>>> condition has been triggered. Isn't the file pointer still just beyond
>>>>>> the last record in the file, even after the first failed READ?

>>>>> You are expected to test for IOSTAT and deal with the end-of-file condition.
>>>>> You are not expected to continue reading the file.

>>>> I actually do test for IOSTAT and deal with the end-of-file condition by
>>>> exiting the DO loop with the READ statement. But once the DO loop has
>>>> been exited, the program is in an outer DO loop, which can also read the
>>>> file.

>>> You need to fix the logic.

>> Apparently I haven't been clear.
>> The program has already been fixed.

> It had NOT been fixed when you wrote the first paragraph above.

On the contrary, the problem was identified and the code modified to deal
with the processor dependency BEFORE I had even started this thread. Of
course, I've said that before. Why do you insist on repeating the same
false claims?

> You wrote: "But once the DO loop has been exited, the program is in
> an outer DO loop, which can also read the file."

And what I wrote is correct. It's still correct, as one loop reads data
and the other loop reads metadata. Of course, I had already written that
as well.

>>>>> The closest anyone has come is Steve Lionel, who said he could
>>>>> make an argument for the second instance not being -1, but he didn't
>>>>> present that argument. That ifort returns -1 upon a second READ
>>>>> demonstrates that the situation is "processor dependent".

> The situation is NOT "processor dependent". The actual numerical value
> is processor dependent", but the sign of the value is NOT. The sign
> is required to be positive. ifort is not standard-conforming.

The sign is required to be positive for error conditions. From reading
the entire thread, it is quite clearly debatable whether reading past
the end of the file more than once is an end-of-file condition or an
error condition. It's situations like this one that often trigger an
"interpretation" of the standard by the standards committee. Maybe
some future standard will clarify the situation. That you fall on one
side of the debate does not mean there are not others on the other side
of the debate. The way I've interpreted the responses from others is
that the presence of a single physical end-of-file marker such as Ctrl-Z
could allow the file pointer to be positioned after the end of the file,
but BEFORE the end-of-file marker, such that a subsequent READ would
cause the reading of the end-of-file marker and trigger the end-of-file
condition, after which the file pointer would be positioned AFTER the
end-of-file marker, and then yet another READ would trigger an error
condition. But if there is no end-of-file marker, then the file pointer
could not be positioned any farther than the end of the file, such that
it remains in the same place no matter how many attempts are made to
READ beyond it. One such READ would look like any other such READ.

>> You wrote "the" standard as if there has been only one.

> There have been a number of standards published.

Glad you agree. Now, try to prove your claim that I haven't read the
standard.

> All say the same thing about IOSTAT since the keyword
> was introduced in FORTRAN 77 -- in regard to the
> value returned for no errors (zero), end of file (a negative
> value) and an error (a positive value).

You seem to be having trouble identifying what the issue is here. No
one is questioning whether positive is for errors and negative is for
end-of-file conditions. The issue is whether multiple reads past the
end of file are all end-of-file conditions or only the first is an
end-of-file condition.

>> In reality, there
>> have been multiple Fortran standards. I have a hardcopy of one of the
>> earlier standards and have read it. I have reference manuals to multiple
>> more recent compilers and I have read them as well. Since you do not know
>> the standard to which my program was written, and you also don't know which
>> of the standards or reference manuals I have read, you're not in a position
>> to make the claim that you did.

> What you say is irrelevant with regard to IOSTAT.

What I said *is* relevant to your claim that I haven't read the standard.

>>>>> My program *WAS* incompatible with gfortran's
>>>>> handling of a second end-of-file READ.

>>>> No, your program was wrong.

>>> Looks like you've finally admitted (tacitly) that you had your tenses wrong.
>>> Given that the different compilers return IOSTAT values with different signs
>>> for the same second end-of-file READ, it can be argued that the situation is
>>> "processor dependent".

>> All the IOSTAT values are processor-dependent (except for zero).
>> However, the value returned for end-of-file is negative.
>> The value for an error condition is positive.
>> This information is in the standard.

>> Irrelevant,

> It's very relevant, since you were testing for an IOSTAT value
> of the wrong sign.

On the contrary, I was testing for an IOSTAT value that indicates an
end-of-file condition. If you've reached the end of the file in one
read loop, one might expect that you've also reached the end of the
file in a different loop that reads the same file.

>>>> given that my program does not test for specific processor-dependent
>>>> values; rather, it tests for negative values. The outer DO loop's IOSTAT negative
>>>> value test has been superfluous since the program now exits the outer named DO loop
>>>> when the inner DO loop encounters the end-of-file condition.

>>>> Forty years ago, programs that OPENed a file and
>>>> started READing worked just fine with compilers that set the file pointer to
>>>> the beginning of the file, until they were moved to a BSD UNIX system whose
>>>> compiler, by default, OPENed a file with the pointer at the end of the file.
>>>> The program wasn't "wrong"; rather, it was incompatible with a processor
>>>> dependency.

>>> Your program was in error when you tried to read the file again,
>>> after receiving end-of-file notification.

>>> Rather, an error condition was triggered when the program tried to read
>>> the file again,

>>> And because your program contains an error, it is not standard conforming.

>> My program does not contain an error. The version that existed prior to me
>> even starting this thread contained an incompatibility with a gfortran
>> processor-dependent feature.

> Your program contained an error.

My program contained an incompatibility with a gfortran processor-dependent
feature.

> It first tested for a negative
> value indicating end-of-file, and then attempted to read another
> record that caused gfortran to return a positive value, indicating
> an error condition. Your program expected another negative value,

That's because my program expected that once the end of the file was
reached, it was still at the end of the file.

> instead of the positive vaue that was require by the Standard.

On the contrary, the standard requires a positive vaue [sic] for an
error condition. What we're dealing with here is a file pointer that
is past the last record of the file.

>>>>>> The current version is compatible with gfortran.

>>>>> but the code included a test on the value of IOSTAT to
>>>>> deal with the condition.

>>>>> That's why you received a positive number for IOSTAT when you tried
>>>>> to read the file after receiving end-of-file.

>>>> Yet ifort returns a negative number. Are you arguing that ifort is in
>>>> error?

>>> ifort is in error.

>> File a bug report for ifort,

> No, if you don't like it, you file a bug report with ifort.

I don't use ifort. You're the one who is claiming that it is in error,
not me. I have no proof that ifort is in error. As such, I have no
motivation to file a bug report.


Click here to read the complete article
Re: end-of-file IOSTAT / debugging

<59890816-aa19-458b-902d-884dfdbec2d7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2681&group=comp.lang.fortran#2681

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:d89:b0:479:6726:7f42 with SMTP id e9-20020a0562140d8900b0047967267f42mr6103468qve.20.1660364523617;
Fri, 12 Aug 2022 21:22:03 -0700 (PDT)
X-Received: by 2002:a81:4f01:0:b0:329:cd02:92c1 with SMTP id
d1-20020a814f01000000b00329cd0292c1mr5976184ywb.63.1660364523453; Fri, 12 Aug
2022 21:22:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 12 Aug 2022 21:22:03 -0700 (PDT)
In-Reply-To: <td77kf$g3h$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:c0e1:af3f:3ef5:2e95;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:c0e1:af3f:3ef5:2e95
References: <tark4g$5or$1@gioia.aioe.org> <7f870d41-15f0-4e21-9fef-f73a72f5519an@googlegroups.com>
<tat4bt$1ndf$1@gioia.aioe.org> <9e943aae-25f8-4d26-a9e0-4d59e22fbe58n@googlegroups.com>
<tau5lg$hp1$1@gioia.aioe.org> <c49da26a-85bb-400d-a9ae-c961c7fcd303n@googlegroups.com>
<tb14nj$v4g$1@gioia.aioe.org> <9c0cc4f4-2951-4837-95b2-440b492ca975n@googlegroups.com>
<tb276p$sqk$1@gioia.aioe.org> <c372b5bc-54cc-4b56-9ec7-682494b31ba3n@googlegroups.com>
<tb8n7m$1h6$1@gioia.aioe.org> <454b4ba8-afa0-49e7-9599-ef01373b1168n@googlegroups.com>
<td77kf$g3h$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <59890816-aa19-458b-902d-884dfdbec2d7n@googlegroups.com>
Subject: Re: end-of-file IOSTAT / debugging
From: gah4@u.washington.edu (gah4)
Injection-Date: Sat, 13 Aug 2022 04:22:03 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3630
 by: gah4 - Sat, 13 Aug 2022 04:22 UTC

On Friday, August 12, 2022 at 9:00:23 PM UTC-7, Dave Tholen wrote:

(snip)

> The sign is required to be positive for error conditions. From reading
> the entire thread, it is quite clearly debatable whether reading past
> the end of the file more than once is an end-of-file condition or an
> error condition. It's situations like this one that often trigger an
> "interpretation" of the standard by the standards committee. Maybe
> some future standard will clarify the situation. That you fall on one
> side of the debate does not mean there are not others on the other side
> of the debate. The way I've interpreted the responses from others is
> that the presence of a single physical end-of-file marker such as Ctrl-Z
> could allow the file pointer to be positioned after the end of the file,
> but BEFORE the end-of-file marker, such that a subsequent READ would
> cause the reading of the end-of-file marker and trigger the end-of-file
> condition, after which the file pointer would be positioned AFTER the
> end-of-file marker, and then yet another READ would trigger an error
> condition. But if there is no end-of-file marker, then the file pointer
> could not be positioned any farther than the end of the file, such that
> it remains in the same place no matter how many attempts are made to
> READ beyond it. One such READ would look like any other such READ.
I guess so.

The description of "end of file record" allows for a physical or virtual
version. It mostly matters for BACKSPACE to work.

Much of the Fortran standard is written to allow for various actual
implementations over the years. And partly that comes from the
record oriented nature of Fortran I/O.

In C, once you get to EOF, you will keep getting one, unless the file
length increases while your program is running.

There are some complications in both Fortran and C when you do
both reading and writing on the same file.

Re: end-of-file IOSTAT / debugging

<td7t11$1mq3$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2683&group=comp.lang.fortran#2683

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!iayahv1glVWjKlPuzXRjog.user.46.165.242.91.POSTED!not-for-mail
From: tholen@antispam.ham (Dave Tholen)
Newsgroups: comp.lang.fortran
Subject: Re: end-of-file IOSTAT / debugging
Date: Sat, 13 Aug 2022 00:05:21 -1000
Organization: Aioe.org NNTP Server
Message-ID: <td7t11$1mq3$1@gioia.aioe.org>
References: <tark4g$5or$1@gioia.aioe.org>
<8786602f-050c-4da4-84a1-c91eb6aea5adn@googlegroups.com>
<tau84d$1h01$1@gioia.aioe.org>
<161f88c5-bf36-4643-bbec-d698addd85c6n@googlegroups.com>
<be4466c7-f962-4a44-908c-9fb16793d6fdn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="56131"; posting-host="iayahv1glVWjKlPuzXRjog.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dave Tholen - Sat, 13 Aug 2022 10:05 UTC

>>>> If I understand it right, you should test for not zero, and act accordingly.

>>>> It is negative for EOF, but positive for I/O errors, which most likely you
>>>> should also exit your loop, and/or handle appropriately.

>>> Not in this particular case. In older versions of the data file I'm
>>> processing, they used csv format to present dozens and dozens of
>>> quantities for each object in the database, and when a value wasn't
>>> available, they simply omitted it, leading to consecutive commas,
>>> and gfortran's list-directed READ statement handled it splendidly.
>>> However, in the latest version of the data file, a missing value is
>>> now represented as "null". For example, five values might be in
>>> this file as:
>>>
>>> 18,97.43,null,-4.31,102
>>>
>>> but attempting to read the characters "null" into an INTEGER or REAL
>>> variable triggers an I/O error.

> Characters are characters, and cannot be read into an integer or real variable.

Hence why I said it triggers an I/O error.

> An appropriate variable would be a CHARACTER variable, but then the
> characters NULL would need to be enclosed in apostrophes.

The data file does have some entries whose values are characters, and
they do enclose those in quotation marks, but not the null entries. I
preferred their previous approach of simply omitting them, leading to
consecutive commas.

> A better approach might be to read the entire line into a CHARACTER variable,
> and then to scan it for 'null, and then to delete the word. Finally read the
> altered line.

I implemented that long ago.

Re: end-of-file IOSTAT / debugging

<td7tbh$1qqe$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2684&group=comp.lang.fortran#2684

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!iayahv1glVWjKlPuzXRjog.user.46.165.242.91.POSTED!not-for-mail
From: tholen@antispam.ham (Dave Tholen)
Newsgroups: comp.lang.fortran
Subject: Re: end-of-file IOSTAT / debugging
Date: Sat, 13 Aug 2022 00:10:57 -1000
Organization: Aioe.org NNTP Server
Message-ID: <td7tbh$1qqe$1@gioia.aioe.org>
References: <tark4g$5or$1@gioia.aioe.org>
<8786602f-050c-4da4-84a1-c91eb6aea5adn@googlegroups.com>
<tau84d$1h01$1@gioia.aioe.org>
<161f88c5-bf36-4643-bbec-d698addd85c6n@googlegroups.com>
<be4466c7-f962-4a44-908c-9fb16793d6fdn@googlegroups.com>
<IeEAK.376383$ssF.201777@fx14.iad>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="60238"; posting-host="iayahv1glVWjKlPuzXRjog.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dave Tholen - Sat, 13 Aug 2022 10:10 UTC

>>>>> If I understand it right, you should test for not zero, and act accordingly.
>>>>> It is negative for EOF, but positive for I/O errors, which most likely you
>>>>> should also exit your loop, and/or handle appropriately.

>>>> Not in this particular case. In older versions of the data file I'm
>>>> processing, they used csv format to present dozens and dozens of
>>>> quantities for each object in the database, and when a value wasn't
>>>> available, they simply omitted it, leading to consecutive commas,
>>>> and gfortran's list-directed READ statement handled it splendidly.
>>>> However, in the latest version of the data file, a missing value is
>>>> now represented as "null". For example, five values might be in
>>>> this file as:
>>>> 18,97.43,null,-4.31,102
>>>> but attempting to read the characters "null" into an INTEGER or REAL
>>>> variable triggers an I/O error.

>> Characters are characters, and cannot be read into an integer or real variable.
>> An appropriate variable would be a CHARACTER variable, but then the
>> characters NULL would need to be enclosed in apostrophes.
>> A better approach might be to read the entire line into a CHARACTER variable,
>> and then to scan it for 'null, and then to delete the word.  Finally read the
>> altered line.

> If each READ statement is definitely reading one and only one line, then reading each line into a character variable, deleting each
> instance of the word 'null', and then reading data from the character variable seems like the easiest solution by far.

And that's what I had implemented months ago. That DO loop exited when the INDEX
function returned a zero value. I'm just glad that modern hardware and compilers
allow for CHARACTER variables at least 2000 characters long.


devel / comp.lang.fortran / Re: end-of-file IOSTAT / debugging

Pages:12345
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor