Re: fix mktemp (remove mktemp ;)
- From
Petr Baudis <pasky@ucw.cz>
- Date
- Apr 16, 2005, 23:37 UTC
- Message-ID
- <20050416233724.GP19099@pasky.ji.cz>
- In-Reply-To
- <20050416232749.23430.93360.sendpatchset@sam.engr.sgi.com>
Dear diary, on Sun, Apr 17, 2005 at 01:27:43AM CEST, I got a letter where Paul Jackson <pj@sgi.com> told me that...
Show 8 quoted lines
> Remove mktemp usage - it doesn't work on > some Mandrakes, nor on my SuSE 8.2 with > mktemp-1.5-531. > > Replace with simple use of $$ (pid). > I've been using this same pattern for > 20 years on many production scripts; > it's fast, solid and simple.
And racy. And not guaranteed to come up with fresh new files.
> More robust tmp file removal, using trap, > so that scripts interrupted by signals > HUP, INT, QUIT or PIPE will cleanup.
But I like this!
I'm deferring those changes to the introduction of a git shell library, which several people volunteered to do so far, but noone sent me any patches for (the last one was probably Martin Mares, only few hours ago though).
-- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor