[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6900: mktemp: want option to make a fifo
From: |
John Reiser |
Subject: |
bug#6900: mktemp: want option to make a fifo |
Date: |
Tue, 24 Aug 2010 12:17:36 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc11 Thunderbird/3.0.4 |
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.
--
- bug#6900: mktemp: want option to make a fifo, (continued)
- bug#6900: mktemp: want option to make a fifo, John Reiser, 2010/08/23
- bug#6900: mktemp: want option to make a fifo, Paul Eggert, 2010/08/23
- bug#6900: mktemp: want option to make a fifo, John Reiser, 2010/08/23
- bug#6900: mktemp: want option to make a fifo, Eric Blake, 2010/08/23
- bug#6900: mktemp: want option to make a fifo, Paul Eggert, 2010/08/23
- bug#6900: mktemp: want option to make a fifo, John Reiser, 2010/08/24
- bug#6900: mktemp: want option to make a fifo, Paul Eggert, 2010/08/24
- bug#6900: mktemp: want option to make a fifo, Paul Eggert, 2010/08/24
- bug#6900: mktemp: want option to make a fifo, John Reiser, 2010/08/24
- bug#6900: mktemp: want option to make a fifo, Paul Eggert, 2010/08/24
- bug#6900: mktemp: want option to make a fifo,
John Reiser <=
- bug#6900: mktemp: want option to make a fifo, Paul Eggert, 2010/08/24
- bug#6900: mktemp: want option to make a fifo, John Reiser, 2010/08/24
- bug#6900: pitfalls of recoding named fifo as pipe, John Reiser, 2010/08/25
- bug#6900: pitfalls of recoding named fifo as pipe, Paul Eggert, 2010/08/25