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: Sat, 26 Jan 2008 14:24:10 -0500 Message-ID: References: <871w844yff.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 1201375473 17256 80.91.229.12 (26 Jan 2008 19:24:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Jan 2008 19:24:33 +0000 (UTC) Cc: Jason Rumney , Drew Adams , Emacs-Devel To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 26 20:24:53 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 1JIqe0-0003L4-Ft for ged-emacs-devel@m.gmane.org; Sat, 26 Jan 2008 20:24:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIqdZ-0003uY-UQ for ged-emacs-devel@m.gmane.org; Sat, 26 Jan 2008 14:24:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JIqdW-0003uQ-AX for emacs-devel@gnu.org; Sat, 26 Jan 2008 14:24:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JIqdU-0003uE-Tj for emacs-devel@gnu.org; Sat, 26 Jan 2008 14:24:18 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIqdU-0003uB-Nm for emacs-devel@gnu.org; Sat, 26 Jan 2008 14:24:16 -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 1JIqdQ-0005Cv-QN; Sat, 26 Jan 2008 14:24:12 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAB8Ym0fO+J95dGdsb2JhbACQKAEwgSGaMX4 X-IronPort-AV: E=Sophos;i="4.25,255,1199682000"; d="scan'208";a="13249623" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 26 Jan 2008 14:24:11 -0500 Original-Received: from pastel.home ([206.248.159.121]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id GUY75011; Sat, 26 Jan 2008 14:24:11 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 00B8D858A; Sat, 26 Jan 2008 14:24:10 -0500 (EST) In-Reply-To: <871w844yff.fsf@gmx.de> (Michael Albinus's message of "Sat, 26 Jan 2008 12:29:56 +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:87594 Archived-At: >> (let ((file-name-handlers-alist nil)) (file-readable-p )). > (and (not (file-remote-p file)) (file-readable-p file)) > There could be file name handlers, which have an own implementation of > file-readable-p for local files. >> I think file-remote-p should really give a kind of performance and >> reliability info: is the file available from local (i.e. fast and >> reliable) storage, or is it only available via a network access which >> may be slow and may fail. > file-remote-p returns information about the *file name*, and not > necessarily about the file: "Can the file name be used literally on the > local host?" I believe this meaning shall be kept, for example, it is > needed to determine whether a file name must be trimmed when used as > argument of process-file and alike. > The new function you are looking for is file-mounted-p or so. I believe you're wrong and I'm right ;-) What you consider as the meaning of `file-remote-p' is pretty close to the info returned by (let ((file-name-handlers-alist nil)) (not (file-readable-p ))), whereas what you want to call `file-mounted-p' is much closer to what `file-remote-p' currently does. E.g. (file-remote-p "/:/") will return nil, even though passing "/:/" as an argument to a subprocess will likely fail to do what was intended. After all, whether the filename can be passed to a subprocess has nothing to do with whether or not it's "remote". I suggest we clarify the meaning of file-remote-p to explain that it returns info that relates to the time and reliability of the access to this file. And we introduce a new one `unhandled-file-name' which returns either "an equivalent name that can passed to subprocesses" (e.g. for the "/:/" file-name-handler, it just strips the leading "/:" and similarly for the "file://" one) or nil if the file cannot be directly accessed by a subprocess (either because it's only accessible via ssh/ftp/tar/younameit it by a file-name-handler). Stefan