Re: fix mktemp (remove mktemp ;)
- From
- Paul Jackson <pj@sgi.com>
- Date
- Apr 17, 2005, 02:46 UTC
- Message-ID
- <20050416194616.27e23f89.pj@sgi.com>
- In-Reply-To
- <4261CC35.4070108@khandalf.com>
> No, you have to:
How does this compare with the one I posted about 1 hour 30 minuts ago:
tmp=${TMPDIR-/tmp}
tmp=$tmp/gitdiff-do.$RANDOM.$RANDOM.$RANDOM.$$
(umask 077 && mkdir $tmp) || {
echo "Could not create temporary directory! Exiting." 1>&2
exit 1
}
t=$tmp/tmp
trap 'rm -fr $tmp; trap 0; exit 0' 0 1 2 3 15derived from the reference that Dave Jones provided?
> create it in O_EXCL mode,
What can one do that and hold that O_EXCL from within bash?
> There are thousands of examples of how to do this with bash.
Care to provide one?
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401