[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: temporary file name, with a twist
From: |
David Kastrup |
Subject: |
Re: temporary file name, with a twist |
Date: |
Fri, 08 Sep 2006 08:30:44 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
nobrowser@gmail.com writes:
> 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.
Emacs CVS has
make-temp-file is a compiled Lisp function in `files.el'.
(make-temp-file PREFIX &optional DIR-FLAG SUFFIX)
Create a temporary file.
The returned file name (created by appending some random characters at the end
of PREFIX, and expanding against `temporary-file-directory' if necessary),
is guaranteed to point to a newly created empty file.
You can then use `write-region' to write new data into the file.
If DIR-FLAG is non-nil, create a new empty directory instead of a file.
If SUFFIX is non-nil, add that at the end of the file name.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum