From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: nobrowser@gmail.com Newsgroups: gmane.emacs.help Subject: Re: temporary file name, with a twist Date: 8 Sep 2006 06:24:45 -0700 Organization: http://groups.google.com Message-ID: <1157721885.311979.282450@p79g2000cwp.googlegroups.com> References: <1157643092.523576.197680@b28g2000cwb.googlegroups.com> <1157694775.190912.163280@i42g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1157722877 4389 80.91.229.2 (8 Sep 2006 13:41:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Sep 2006 13:41:17 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 08 15:41:16 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GLgbD-0006Gw-VD for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Sep 2006 15:40:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GLgbD-0000PY-DB for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Sep 2006 09:40:51 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!p79g2000cwp.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: 69.194.204.172 Original-X-Trace: posting.google.com 1157721890 21195 127.0.0.1 (8 Sep 2006 13:24:50 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 8 Sep 2006 13:24:50 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060406 Firefox/1.5.0.4 (Debian-1.5.dfsg+1.5.0.4-1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: p79g2000cwp.googlegroups.com; posting-host=69.194.204.172; posting-account=YFHMlw0AAAAi2Uh6TQSJVnQoj9NpSiGG Original-Xref: shelby.stanford.edu gnu.emacs.help:141609 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37231 Archived-At: 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