From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: testing for a remote file to include file on a Windows mapped drive Date: Mon, 21 Apr 2008 00:55:57 -0700 Message-ID: <000801c8a385$22a389e0$0200a8c0@us.oracle.com> References: <87bq781bf7.fsf@gmx.de><000a01c8a314$5fff7630$0200a8c0@us.oracle.com><000d01c8a324$97820590$0200a8c0@us.oracle.com><000f01c8a334$b2a40660$0200a8c0@us.oracle.com><000101c8a37f$eeb543d0$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1208764618 11646 80.91.229.12 (21 Apr 2008 07:56:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Apr 2008 07:56:58 +0000 (UTC) Cc: 'Emacs-Devel' , 'Stefan Monnier' , 'Jason Rumney' To: "'Michael Albinus'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 21 09:57:29 2008 connect(): Connection refused 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 1Jnqtt-0008Eb-I0 for ged-emacs-devel@m.gmane.org; Mon, 21 Apr 2008 09:57:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JnqtE-00051r-3Z for ged-emacs-devel@m.gmane.org; Mon, 21 Apr 2008 03:56:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jnqt9-00051i-At for emacs-devel@gnu.org; Mon, 21 Apr 2008 03:56:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jnqt8-00051N-Ht for emacs-devel@gnu.org; Mon, 21 Apr 2008 03:56:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jnqt8-00051J-AM for emacs-devel@gnu.org; Mon, 21 Apr 2008 03:56:34 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jnqt4-0003aG-2r; Mon, 21 Apr 2008 03:56:30 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jnqt3-0004D5-Cz; Mon, 21 Apr 2008 03:56:29 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m3L7uPt7025673; Mon, 21 Apr 2008 02:56:25 -0500 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m3L5OIcu004012; Mon, 21 Apr 2008 01:56:24 -0600 Original-Received: from inet-141-146-46-1.oracle.com by acsmt350.oracle.com with ESMTP id 3654978661208764536; Mon, 21 Apr 2008 00:55:36 -0700 Original-Received: from dradamslap1 (/141.144.64.98) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 Apr 2008 00:55:36 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acijg81FQ7GpnRkTQdyY6s7aVLuhsAAAINkQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by mx20.gnu.org: Linux 2.4-2.6 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:95605 Archived-At: > > As you said, the purpose of file-remote-p is to determine, > > without the cost of a remote access, whether a file name > > represents a remote file. The aim in using it > > is to be able to know that a file is remote, so you might > > then avoid the cost of accessing it. > > > > * A file on a Windows mapped network drive is remote, in > > the sense of incurring a performance penalty for access. > > `file-remote-p' should return non-nil for such a file, > > but nil for a file on a Windows local drive. That is not > > the case now. > > I believe, we are speaking about 2 different functions: > > * file-remote-p returns t, if a file is not directly accessible by > underlying operating system's means. Such files always need some > special file name handler functions in Emacs for proper > handling. Such (absolute) file names cannot be used literally > outside functions, which support file name handlers. > > * file-mounted-p (as working name) returns t, if a file looks like an > ordinary file from the operating system's point of view, but its > physical location is on another machine. Examples are nfs, smbfs or > sshfs mounts under GNU/Linux, or network shares under W32. This > property cannot be detected by file name handler functions. The > implementation shall be in the C core. > > These functions are exclusive: file-remote-p and file-mounted-p shall > not return t for the same filename. Since one function uses the > filename only for checking the result, and the other function uses > operating system properties, I don't believe it makes sense to merge > them into one function. > > A test for "slow access" is therefore > > (or (file-mounted-p filename) > (file-remote-p filename)) I see. I wasn't aware of `file-mounted-p'. I don't see it in my January build of Emacs 23. > > So if ffap-ftp-regexp is subsumed by an ange-ftp test, the > > question becomes whether that ange-ftp test should be > > included in `file-remote-p'. > > The relevant test for ange-ftp is included in file-remote-p. I guessed that. But in that case, perhaps it should be included at an earlier stage, so that the performance (as shown by your tests) reflects that of `ffap-ftp-regexp'. My question was really about my code - whether I still need to use both tests. I guess the answer is yes, at least for now; if not for pattern completeness (coverage), at least for performance (try the ffap patterns first).