GNU bug report logs - #6900
mktemp: want option to make a fifo

Previous Next

Package: coreutils;

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

From: John Reiser <jreiser <at> bitwagon.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Eric Blake <eblake <at> redhat.com>, 6900 <at> debbugs.gnu.org
Subject: bug#6900: mktemp: want option to make a fifo
Date: Tue, 24 Aug 2010 11:03:17 -0700
On 08/23/2010 04:49 PM, Paul Eggert wrote:
> Here's a quick sketch
> of a shell script that solves the stated problem without using a
> named fifo.

  [snip]
> maybe_b2() { read line && sed 's/^./D/'; }

> a | (b1 | maybe_b2) 3>&1 | c

Thank you for reminding me about using "3>&1" for "fan-in" multiplexing.
This can work for B2, B3, ..., B8 but cannot handle more because shell
is allowed to balk at redirecting fd greater than 9.  It can be limited
further if any of the Bi already use other low file descriptors.  I also
prefer to think about the situation as "B1 is doing fan-out multiplexing"
rather than "C is doing fan-in multiplexing", because the "C" end is
more "constant" and the "B" end is more "variable".

I dislike the part "(b1 | maybe_b2)" because in practice it tends to be
fragile.  When things go wrong it is hard to diagnose and recover.
Also, I do not see how to extend it for the case of more than one
conditional process whose startup should be delayed (B3, B4, ...),
such as the 'sed' in "read line && sed ...".

-- 




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.