[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 20:14:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> Yes, but temporary-file-directory just returns the directory, you
> still need to create the file itself.  And due to remote
> communications, the window between these two events can be quite
> large, so we can be a victim of a race condition with probability that
> is too high.
> That is why I thought that maybe a single function that actually
> creates the file and returns its name could be better.

I see. Yes, it makes sense. But we shouldn't extend just
`make-temp-file' with a file name handler; often it is mandatory to get
a local temporary file, even if `default-directory' is remote. Another
function, with the same footprint as `make-temp-file', would be
useful. A pair like we have already for `call-process'/`process-file',
for example.

`make-remote-temp-file' comes to mind, but this would imply that the
result resides on a remote host. It should still behave like
`make-temp-file' when `default-directory' is local, and even in case it
calls a file name handler, that handler must not support remote files.
Maybe you have a better name.

A `temporary-file-directory' function might still be useful, for example
when you call a remote process, and you want it to pass as argument, or
make it the default remote directory while running the process.

Best regards, Michael.

reply via email to

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