GNU bug report logs -
#6900
mktemp: want option to make a fifo
Previous Next
Reported by: John Reiser <jreiser <at> bitwagon.com>
Date: Mon, 23 Aug 2010 15:41:01 UTC
Severity: normal
Tags: notabug
Merged with 6330
Done: Jim Meyering <jim <at> meyering.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 08/24/2010 11:32 AM, Paul Eggert wrote:
[snip]
> Again, once things get this complicated, it doesn't cost any more
> processes to use a temporary directory, with something like this:
>
> dir=$(mktemp -d dir.XXXXXX)
> mkfifo $dir/1 $dir/2
> listener1 < $dir/1
> listener2 < $dir/2
> cmd1 2> $dir/1 | cmd2 2> $dir/2
>
> This example can also be simplified and made more robust by using
> pipes instead of named fifos, as follows:
>
> (echo quit 1 | cmd1 3<&0 <&4) 4<&0 |
> (: | cmd2 3<&0 <&4) 4<&0
That simplification loses functionality because it "binds" the cmdin
channels to a specific process or pipeline. I gave the example
"echo quit > $fifo_cmdin1" only to emphasize that the command-
and-control inputs are separate from the "main" dataflow which goes
through the regular pipes. When I want to control a pipeline or
nest of processes interactively, then I don't know in advance
which process, which commands, or in which sequence to give them.
Using fifos allows for arbitrary flexibility of "fanout multiplexing"
my interactive commands. I choose which fifo for each command,
at the time that the I give the command. That cannot be done
with fixed anonymous pipes.
--
This bug report was last modified 13 years and 350 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.