[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: About problems with named pipes




On 10/11/2025 08:35, Nicolas George wrote:
Thomas Schmitt (HE12025-11-10):
Is the "|" in "zcat TheFile.gz | MyFifo" a typo ?
I get an immediate error

   -bash: MyFifo : Permission denied

Either you doctored the output or your config is dangerously broken.

Maybe mkfifo is "dangerously broken" on Trixie, then? According to it's man page[1], the option "-m, --mode=MODE" can be used to set permissions "to MODE, not a=rw", which I interpret to mean that, if this option is not supplied, the default permissions are "a=rw". So, invoking "mkfifo MyFifo" will create a named pipe with permissions "a=rw".

Now, as we have seen explained in earlier threads, the "|" command routes stdout from the left command to stdin of the left command. So isn't it reasonable for the "|" command to assume the right option *is* a command? But we've just seen that MyFifo will not be given executable permissions by default.

In fact, fifo(7) starts with "A FIFO special file (a named pipe) is similar to a pipe, except that it is accessed as part of the filesystem. It can be opened by multiple processes for reading or writing".

So, I contend that writing to MyFifo (aka "zcat TheFile.gz > MyFifo") is the the correct command. Attempting to execute MyFifo and pipe into it's stdin seems - to me - to be the "dangerously broken" option and the "permission denied" error was the safety net.

[1] https://manpages.debian.org/trixie/coreutils/mkfifo.1.en.html#m


Regards,

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


Reply to: