[J3] Not seeing EOF when reading FIFO in Intel ifx on Linux

Van Snyder van.snyder at sbcglobal.net
Sun Aug 24 00:15:54 UTC 2025


I have a program that reads several file names from stdin and processes
data in those files. To save space, I would like to compress them using
gzip, and then read them through a fifo after being uncompressed by
zcat:


    inquire ( file='MyFifo', exist=exist )
    if ( .not. exist ) call execute_command_line ( 'mkfifo MyFifo' )
    ...
    do
      read ( *, '(a)', end=9 ) file
      if ( index(file,'.gz') /= 0 ) then
        inquire ( file=file, exist=exist, iomsg=iomsg )
        if ( .not. exist ) go to 66
        open ( newunit=u, file='MyFifo', status='old', err=666, iomsg=iomsg )
        call execute_command_line ( 'zcat ' // trim(file) // '> MyFifo' )
      else
        open ( newunit=u, file=trim(file), status='old', err=66, iomsg=iomsg )
      end if
    f:do
        read ( u, '(a)', end=2 ) line
        ...
      end do f
    2 close ( u )
      ...
    end do

The first file is read fine, but the EOF isn't sensed, the end=2 branch
isn't taken, and subsequent files are not processed.

When I run "zcat foo.gz > MyFifo" in one xTerm and "less -f MyFifo" in
another, less sees the EOF.

If I open MyFifo AFTER the Execute_Command_Line the program hangs
without reading anything, and Csh complains about not being able to
create the fifo when I try to kill the program with Ctrl-C:

Csh: 1: cannot create MyFifo: Interrupted system call

Is there something more or different that I need to do?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20250823/7ae05ad0/attachment.htm>


More information about the J3 mailing list