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: testing for a remote file to include file on a Windows mappeddrive Date: Wed, 30 Jan 2008 12:49:30 -0500 Message-ID: References: <871w844yff.fsf@gmx.de> <87bq781bf7.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1201715407 27087 80.91.229.12 (30 Jan 2008 17:50:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jan 2008 17:50:07 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, drew.adams@oracle.com, jasonr@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 30 18:50:26 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JKH4o-0000Jl-40 for ged-emacs-devel@m.gmane.org; Wed, 30 Jan 2008 18:50:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKH4M-00032d-Sq for ged-emacs-devel@m.gmane.org; Wed, 30 Jan 2008 12:49:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JKH4J-00032Q-EI for emacs-devel@gnu.org; Wed, 30 Jan 2008 12:49:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JKH4E-00031d-IJ for emacs-devel@gnu.org; Wed, 30 Jan 2008 12:49:51 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKH4E-00031T-Cu for emacs-devel@gnu.org; Wed, 30 Jan 2008 12:49:46 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JKH46-0008G1-QW; Wed, 30 Jan 2008 12:49:39 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAA9IoEfO+J95dGdsb2JhbACQJwEwn2SBAg X-IronPort-AV: E=Sophos;i="4.25,278,1199682000"; d="scan'208";a="13409164" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 30 Jan 2008 12:49:31 -0500 Original-Received: from pastel.home ([206.248.159.121]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id KSB94530; Wed, 30 Jan 2008 12:49:30 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 3C25385F8; Wed, 30 Jan 2008 12:49:30 -0500 (EST) In-Reply-To: (Michael Albinus's message of "Wed, 30 Jan 2008 17:04:36 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:87787 Archived-At: >>> I'm lost. What do you expect as result of (nonmagic-file-name "/sudo::") ? >> nil >> because this directory is (most likely) not accessible to a subprocess >> run locally by Emacs. > And in the unlikely case, the user can access "/root" nonmagically, it > shall return that string? Since unhandled-file-name can return nil, the code that uses it has to be able to deal with the case where the function returns nil (most likely, it will use something like file-local-copy to make a copy that can then be passed to the subprocess), so returning nil when the file is actually accessible is suboptimal but correct and safe. In other words, I'd rather just return nil even if /root happens to be accessible because (who knows) the subprocess may actually need to write to that directory. And if /root is also available for write, then I think this case is sufficiently unlikely or scary that returning nil is good enough. Stefan