[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"mktemp" is a BSD-ism and there are others around....
From: |
Bruce Korb |
Subject: |
"mktemp" is a BSD-ism and there are others around.... |
Date: |
Sun, 30 Oct 2005 09:50:19 -0800 |
User-agent: |
KMail/1.7.1 |
The other variation on "mktemp" uses "illegal option"
(you get arrested if you use one). BTW, if the "mktemp -d -q"
is successful in creating a file, shouldn't you remove the
file before trying another method?
$ cvs diff -u ./lib/Autom4te/General.pm
Index: ./lib/Autom4te/General.pm
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/Autom4te/General.pm,v
retrieving revision 1.34
diff -u -r1.34 General.pm
--- ./lib/Autom4te/General.pm 14 May 2005 07:00:39 -0000 1.34
+++ ./lib/Autom4te/General.pm 30 Oct 2005 17:46:34 -0000
@@ -310,10 +310,16 @@
my ($signature) = @_;
my $TMPDIR = $ENV{'TMPDIR'} || '/tmp';
- # If mktemp supports dirs, use it.
- $tmp = `(umask 077 &&
- mktemp -d -q "$TMPDIR/${signature}XXXXXX") 2>/dev/null`;
+ $tmp = `(mktemp -@ 2>&1) | grep 'invalid option'`;
chomp $tmp;
+
+ if ($tmp)
+ {
+ # If mktemp supports dirs, use it.
+ $tmp = `(umask 077 &&
+ mktemp -d -q "$TMPDIR/${signature}XXXXXX") 2>/dev/null`;
+ chomp $tmp;
+ }
if (!$tmp || ! -d $tmp)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- "mktemp" is a BSD-ism and there are others around....,
Bruce Korb <=