help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: temporary file name, with a twist


From: nobrowser
Subject: Re: temporary file name, with a twist
Date: 8 Sep 2006 06:24:45 -0700
User-agent: G2/0.2

Reiner Steib wrote:
> On Fri, Sep 08 2006, nobrowser@gmail.com wrote:
>
> > Reiner Steib wrote:
> >> On Thu, Sep 07 2006, nobrowser@gmail.com wrote:
> >>
> >> > in my lisp code, I need to get a unique temporary file name, but
> >> > _with a specific suffix_.
> >>
> >> `make-temp-file' or `make-temp-name'?
> >>
> >
> > Nope, that's what I started with.  Doesn't do the suffix part.
>
> In addition to David's comment, I'd say it's not exactly hard to
> append a suffix when using `make-temp-name'; at least easier than
> creating maildir-like[1] names.

At the slight risk of further insulting a deceased equine, let me
explain:

either way, with make-temp-name or with handcrafted names, I have,
theoretically, the classic tmpnam(3) race condition.  The difference is
that with my own, I control the algorithm so I can be confident that
the race won't actually happen in practice.  I don't have that
confidence with the Emacs names, which for all I know are generated
with tmpnam.  The doc says only that "The Emacs process number forms
part of the result".  But how unique are they actually, what's the
length of the cycle?

Thanks,
i



reply via email to

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