1014 |
|
|
1015 |
(defun ange-ftp-hash-entry-exists-p (key tbl) |
(defun ange-ftp-hash-entry-exists-p (key tbl) |
1016 |
"Return whether there is an association for KEY in TABLE." |
"Return whether there is an association for KEY in TABLE." |
1017 |
(not (eq (gethash key tbl 'unknown) 'unknown))) |
(and tbl (not (eq (gethash key tbl 'unknown) 'unknown)))) |
1018 |
|
|
1019 |
(defun ange-ftp-hash-table-keys (tbl) |
(defun ange-ftp-hash-table-keys (tbl) |
1020 |
"Return a sorted list of all the active keys in TABLE, as strings." |
"Return a sorted list of all the active keys in TABLE, as strings." |
2919 |
;; error message. |
;; error message. |
2920 |
(gethash "." ent)) |
(gethash "." ent)) |
2921 |
;; Child lookup failed, so try the parent. |
;; Child lookup failed, so try the parent. |
2922 |
(let ((table (ange-ftp-get-files dir 'no-error))) |
(ange-ftp-hash-entry-exists-p |
2923 |
;; If the dir doesn't exist, don't use it as a hash table. |
file (ange-ftp-get-files dir 'no-error)))))) |
|
(and table |
|
|
(ange-ftp-hash-entry-exists-p file |
|
|
table))))))) |
|
2924 |
|
|
2925 |
(defun ange-ftp-get-file-entry (name) |
(defun ange-ftp-get-file-entry (name) |
2926 |
"Given NAME, return the given file entry. |
"Given NAME, return the given file entry. |
3371 |
(setq file (ange-ftp-expand-file-name file)) |
(setq file (ange-ftp-expand-file-name file)) |
3372 |
(if (ange-ftp-ftp-name file) |
(if (ange-ftp-ftp-name file) |
3373 |
(condition-case nil |
(condition-case nil |
3374 |
(let ((file-ent |
(let ((ent (ange-ftp-get-files (file-name-directory file)))) |
3375 |
(gethash |
(and ent |
3376 |
(ange-ftp-get-file-part file) |
(stringp (setq ent |
3377 |
(ange-ftp-get-files (file-name-directory file))))) |
(gethash (ange-ftp-get-file-part file) ent))) |
3378 |
(and (stringp file-ent) file-ent)) |
ent)) |
3379 |
;; If we can't read the parent directory, just assume |
;; If we can't read the parent directory, just assume |
3380 |
;; this file is not a symlink. |
;; this file is not a symlink. |
3381 |
;; This makes it possible to access a directory that |
;; This makes it possible to access a directory that |