[Top][All Lists]

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

Re: Remote temporary directory

From: Michael Albinus
Subject: Re: Remote temporary directory
Date: Wed, 27 Jul 2016 18:56:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

Hi Eli,

>> (defun temporary-file-directory (&optional base)
>>   "The directory for writing temporary files.
>> BASE indicates the host where this directory is located.  If this
>> is a remote file name, the directory for writing temporary files
>> is located on the same host.  A local file name for BASE lets the
>> function return the value of the variable `temporary-file-directory'.
>> The default value of BASE is `default-directory'."
>> --8<---------------cut here---------------end--------------->8---
>> Then you could call
>> (let ((temporary-file-directory (temporary-file-directory)))
>>   (make-temp-file "my-prefix))
>> Similar for `make-temp-name'.
> I don't understand what you meant by the last sentence.  Currently,
> make-temp-name doesn't support remote files and doesn't pay attention
> to temporary-file-directory.

You're right, my bad. `make-temp-name' doesn't pay attention to any directory.

> It seems to me that we need to extend make-temp-file to support remote
> files, but I see no reason to extend temporary-file-directory for that
> purpose, sincea remote version of make-temp-file will invoke utilities
> that might have their own ideas about where temporary file should live
> and how they should be called.

These "utilities that might have their own ideas about where temporary
file should live" are triggered by the function `temporary-file-directory'
proposed above. It would call a file name handler, if BASE (or its
default value `default-directory') indicates this.

If you find it too confusing, that the function has the same name like
the existing variable, we could choose any other name.

Best regards, Michael.

reply via email to

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