emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: testing for a remote file to include file on a Windows mapped drive


From: Michael Albinus
Subject: Re: testing for a remote file to include file on a Windows mapped drive
Date: Mon, 21 Apr 2008 09:46:48 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (hpux)

"Drew Adams" <address@hidden> writes:

> 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))

> [Apologies, Michael, for quoting off-list mail; I assumed you wouldn't mind.]

No problem, you can always quote me, unless I've stated otherwise.

> 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.

Best regards, Michael.





reply via email to

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