emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: ange-ftp errors out for some directories


From: lawrence mitchell
Subject: Re: ange-ftp errors out for some directories
Date: Thu, 03 Jul 2003 19:20:26 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50

Richard Stallman wrote:

> Does this replacement function give good results?

> (defun ange-ftp-file-symlink-p (file)
>   ;; call ange-ftp-expand-file-name rather than the normal
>   ;; expand-file-name to stop loops when using a package that
>   ;; redefines both file-symlink-p and expand-file-name.
>   (setq file (ange-ftp-expand-file-name file))
>   (if (ange-ftp-ftp-name file)
>       (condition-case nil
>         (let ((file-ent
>                (gethash
>                 (ange-ftp-get-file-part file)
>                 (ange-ftp-get-files (file-name-directory file)))))
>           (and (stringp file-ent) file-ent))
>       ;; If we can't read the parent directory, just assume
>       ;; this file is not a symlink.
>       ;; This makes it possible to access a directory that
>       ;; whose parent is not readable.

I've finally got around to being able to test this, however, this
function seems incomplete.  Did you mean to write something like:

(defun ange-ftp-file-symlink-p (file)
  ;; call ange-ftp-expand-file-name rather than the normal
  ;; expand-file-name to stop loops when using a package that
  ;; redefines both file-symlink-p and expand-file-name.
  (setq file (ange-ftp-expand-file-name file))
  (if (ange-ftp-ftp-name file)
      (condition-case nil
          (let ((file-ent
                 (gethash
                  (ange-ftp-get-file-part file)
                  (ange-ftp-get-files (file-name-directory file)))))
            (and (stringp file-ent) file-ent))
        ;; If we can't read the parent directory, just assume
        ;; this file is not a symlink.
        ;; This makes it possible to access a directory that
        ;; whose parent is not readable.
        (error nil))
      (ange-ftp-real-file-symlink-p file)))

-- 
lawrence mitchell <address@hidden>





reply via email to

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