From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Remote temporary directory Date: Fri, 29 Jul 2016 17:02:19 -0400 Message-ID: References: <837fch1vmw.fsf@gnu.org> <8536522f-fa3f-9fe0-63c0-262b8191b4a3@gmail.com> <83h9bdttxi.fsf@gnu.org> <87lh0ons06.fsf@gmx.de> <83r3afst6v.fsf@gnu.org> <87k2g7pfmx.fsf_-_@gmx.de> <83lh0nrrjs.fsf@gnu.org> <87fuqvxbo8.fsf@gmx.de> <83a8h3rnib.fsf@gnu.org> <87a8h3x81p.fsf@gmx.de> <87oa5g42v5.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1469826038 30570 80.91.229.3 (29 Jul 2016 21:00:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jul 2016 21:00:38 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 29 23:00:23 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bTEtK-0002yi-Dv for ged-emacs-devel@m.gmane.org; Fri, 29 Jul 2016 23:00:22 +0200 Original-Received: from localhost ([::1]:33256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTEtE-00077l-GL for ged-emacs-devel@m.gmane.org; Fri, 29 Jul 2016 17:00:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTEt9-00075c-Dh for emacs-devel@gnu.org; Fri, 29 Jul 2016 17:00:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTEt5-0005v6-Au for emacs-devel@gnu.org; Fri, 29 Jul 2016 17:00:10 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:39798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTEt5-0005pk-3i for emacs-devel@gnu.org; Fri, 29 Jul 2016 17:00:07 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bTEsv-0002pN-EP for emacs-devel@gnu.org; Fri, 29 Jul 2016 22:59:57 +0200 Original-Received: from modemcable222.169-23-96.mc.videotron.ca ([96.23.169.222]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Jul 2016 22:59:57 +0200 Original-Received: from monnier by modemcable222.169-23-96.mc.videotron.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Jul 2016 22:59:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: modemcable222.169-23-96.mc.videotron.ca User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:1SVBW28jm71aVshs9TLHlbjJqlE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206234 Archived-At: >> `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. > I'm a little bit undecided. Shall I try it this way? A better name? Maybe a new `make-nearby-temp-file` would work, where Emacs would try to create the temp file "as close as possible" to some target directory. This could also be used for things like "save into a temp file and then rename that file to the actual destination". This said, there are some non-trivial security issues at stake here: make-temp-file should usually only be used in directories which are either only writable by "trusted" users (i.e. only by the current user), or which have the magical "sticky" bit set. So using just any writable "nearby" directory is generally unsafe. Stefan