Re: [TopGit PATCH/RFC] Do not use mktemp
- From
Jonathan Nieder <jrnieder@uchicago.edu>
- Date
- Aug 12, 2008, 21:07 UTC
- Message-ID
- <Pine.GSO.4.62.0808121557290.24244@harper.uchicago.edu>
- In-Reply-To
- <20080812204433.GM10151@machine.or.cz>
Hi,
Petr Baudis wrote:
Show 6 quoted lines
> On Tue, Aug 12, 2008 at 01:14:27PM -0500, Jonathan Nieder wrote: > > Old operating systems may not even have mktemp; less old > > operating systems may have a mktemp which is not compatible with > > the usual post-1.5 version. Let's try to do without. > > can you give some concrete examples?
SunOS 5.8 has no mktemp (which is not so bad, because as you say, we could provide our own stub).
Mac OS X mktemp does not allow omitting the template argument but otherwise shouldn't be much of a problem. On Mac OS X (and old BSDs, too, presumably), "mktemp -t arg" treats arg as a prefix for a filename rather than a template for a filename, but that is just a cosmetic problem.
So thinking it through, perhaps we should do the following: - provide a simple mini-mktemp for users install to install themselves on old systems - always provide the template argument to mktemp
The arcane umask use would then go in that mini-mktemp which most people would not be using. I still would appreciate suggestions from any shell hackers on how to implement it properly (in particular, how to get random numbers that change more than once/second).
I'll work on a patch in a few hours when I get home. Thanks for the comments.
Jonathan