Mercurial > emacs
comparison lisp/net/ange-ftp.el @ 51799:2a6ed9e210b2
(ange-ftp-file-symlink-p):
Use condition-case to catch error in ange-ftp-get-files.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 07 Jul 2003 20:55:38 +0000 |
parents | 2bf79af13e21 |
children | abb0fb200345 |
comparison
equal
deleted
inserted
replaced
51798:04564d8f3be9 | 51799:2a6ed9e210b2 |
---|---|
3369 ;; call ange-ftp-expand-file-name rather than the normal | 3369 ;; call ange-ftp-expand-file-name rather than the normal |
3370 ;; expand-file-name to stop loops when using a package that | 3370 ;; expand-file-name to stop loops when using a package that |
3371 ;; redefines both file-symlink-p and expand-file-name. | 3371 ;; redefines both file-symlink-p and expand-file-name. |
3372 (setq file (ange-ftp-expand-file-name file)) | 3372 (setq file (ange-ftp-expand-file-name file)) |
3373 (if (ange-ftp-ftp-name file) | 3373 (if (ange-ftp-ftp-name file) |
3374 (let ((file-ent | 3374 (condition-case nil |
3375 (gethash | 3375 (let ((file-ent |
3376 (ange-ftp-get-file-part file) | 3376 (gethash |
3377 (ange-ftp-get-files (file-name-directory file))))) | 3377 (ange-ftp-get-file-part file) |
3378 (and (stringp file-ent) file-ent)) | 3378 (ange-ftp-get-files (file-name-directory file))))) |
3379 (and (stringp file-ent) file-ent)) | |
3380 ;; If we can't read the parent directory, just assume | |
3381 ;; this file is not a symlink. | |
3382 ;; This makes it possible to access a directory that | |
3383 ;; whose parent is not readable. | |
3384 (file-error nil)) | |
3379 (ange-ftp-real-file-symlink-p file))) | 3385 (ange-ftp-real-file-symlink-p file))) |
3380 | 3386 |
3381 (defun ange-ftp-file-exists-p (name) | 3387 (defun ange-ftp-file-exists-p (name) |
3382 (setq name (expand-file-name name)) | 3388 (setq name (expand-file-name name)) |
3383 (if (ange-ftp-ftp-name name) | 3389 (if (ange-ftp-ftp-name name) |