[Top][All Lists]

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

bug#6330: Feature request: mktemp creates named pipes

From: Jim Meyering
Subject: bug#6330: Feature request: mktemp creates named pipes
Date: Sat, 05 Jun 2010 09:25:25 +0200

Sebastien Andre wrote:
> I see two reasons why the addition of a --fifo option is better than using
> existing tools:
>     * Creating a temporary directory to finally create a pipe just because
> it is safe this way is kind of a trick. For the clarity of scripts, it would
> be better having mktemp to ensure the uniqueness of a fifo, even if it's
> created in /

"because it is safe" is often a good reason to learn and use a new idiom.
When you first encounter such an idiom, it does indeed look like a "trick".

>     * mktemp is not only a tool to create unique files, it's also a name
> generator. The example given in the manual works for one or two fifos, but
> if the number of fifos is unknown there is no choice but implementing
> something to generate names, which is another potential source of bugs.

Any code addition is an opportunity to introduce bugs ;-)

What if someone wants a uniquely-named symlink?
New option?  ... or a shared memory object?  Add another?
Wouldn't it be better to use the tried and true (safe) idiom
that will work with all versions of mktemp?  Then
your script will work also on systems that use the
version of mktemp that predated the one in coreutils.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]