[J3] EOF not detected

malcolm at nag-j.co.jp malcolm at nag-j.co.jp
Tue Nov 11 02:43:59 UTC 2025


Hi Van,

The reason is that there is no EOF while any process has the FIFO open for writing.(this is what the man pages say!).

If you open a file without ACTION='READ', it will be open for writing as well as reading. The exact same thing happens in C if you fopen with "r+" instead of "r".

Both gfortran and nagfor will detect the end of file if opened with ACTION='READ'. I do not have a copy of ifx immediately at hand to test it, but I would expect that it would do similarly.

Cheers,
--
..................Malcolm Cohen, NAG Oxford/Tokyo.

-----Original Message-----
From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Steve Lionel via J3
Sent: Tuesday, November 11, 2025 8:51 AM
To: j3 at mailman.j3-fortran.org
Cc: Steve Lionel <steve at stevelionel.com>
Subject: Re: [J3] EOF not detected

On 11/10/2025 3:51 PM, Van Snyder via J3 wrote:
> Reading and processing the compressed files using the above methods 
> takes 25 seconds.
>
> I also tried appending EOF to the files before compressing them and 
> then reading them using the first method, with the same result.
>
> (1) Why does END= not branch when reading from a FIFO?
>
> (2) Why does it run so much longer when reading from a FIFO?

There's no such thing as "appending EOF". Your problem description is far too vague and missing useful information, as well as depending on non-Fortran things. Can you come up with a short but complete Fortran example that demonstrates whatever problem you're describing?

END= triggers when there is an attempt to read past the end of the file.

Steve



More information about the J3 mailing list