Re: About problems with named pipes
On Mon, Nov 10, 2025 at 14:32:46 +0100, Thomas Schmitt wrote:
> > the original command presented by Van Snyder was:
> >
> > zcat TheFile.gz | MyFifo
> >
> > and that | is a typo. It should have been > instead.
>
> I'm curiously waiting for more info about the data consumer program.
> It seems unlikely that "zcat TheFile.gz" alone can hang depending on
> the size of TheFile.gz (compressed or uncompressed).
It's completely normal and expected for the *first* process which opens
a named pipe to hang, while waiting for a *second* process to open it.
Once it has been opened twice (once for reading, once for writing),
the processes will wake up and be able to communicate.
The size of the input shouldn't matter. The hang occurs upon the
initial open, before any writes are allowed.
As it turns out (from other messages in this wandering thread), Van
Snyder's actual commands were:
zcat TheFile.gz > MyFifo
echo EOF > MyFifo
That's two separate opens (for write) and two separate closes. If there
was only one reader, then the second command would hang waiting for a
second reader.
I believe it was Thomas who proposed combining them into a single open:
(zcat TheFile.gz; echo EOF) > MyFifo
which may or may not solve Van's problem.
The real moral of this thread is that when you're asking a technical
question, you should paste *exactly* what you're doing. Don't retype
it, and don't go from memory. Actually paste the text from your terminal
into your email. Every tiny little detail matters.
Reply to: