diff options
author | Richard M. Stallman <rms@gnu.org> | 1998-01-17 19:44:51 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1998-01-17 19:44:51 +0000 |
commit | 05eacca7da8ae525d6b41d6dacef473ce17b40e1 (patch) | |
tree | 850df7bbd48c3d1ef798d34c025bd30b46173991 /lisp/ange-ftp.el | |
parent | 9e5b2813acd335c0106d330e54857bdc58bd20ae (diff) | |
download | emacs-05eacca7da8ae525d6b41d6dacef473ce17b40e1.tar.gz |
(ange-ftp-inodes-hashtable): New variable.
(ange-ftp-next-inode-number): New variable.
(ange-ftp-file-attributes): Assign each file a unique "inode number".
Diffstat (limited to 'lisp/ange-ftp.el')
-rw-r--r-- | lisp/ange-ftp.el | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lisp/ange-ftp.el b/lisp/ange-ftp.el index 0d395dd0402..c00737bee15 100644 --- a/lisp/ange-ftp.el +++ b/lisp/ange-ftp.el @@ -1010,6 +1010,12 @@ All HOST values should be in lower case.") (defvar ange-ftp-files-hashtable (ange-ftp-make-hashtable 97) "Hash table for storing directories and their respective files.") +(defvar ange-ftp-inodes-hashtable (ange-ftp-make-hashtable 97) + "Hash table for storing file names and their \"inode numbers\".") + +(defvar ange-ftp-next-inode-number 1 + "Next \"inode number\" value. We give each file name a unique number.") + (defvar ange-ftp-ls-cache-lsargs nil "Last set of args used by ange-ftp-ls.") @@ -3294,7 +3300,13 @@ system TYPE.") (let ((host (nth 0 parsed)) (user (nth 1 parsed)) (name (nth 2 parsed)) - (dirp (ange-ftp-get-hash-entry part files))) + (dirp (ange-ftp-get-hash-entry part files)) + (inode (ange-ftp-get-hash-entry + file ange-ftp-inodes-hashtable))) + (unless inode + (setq inode ange-ftp-next-inode-number + ange-ftp-next-inode-number (1+ inode)) + (ange-ftp-put-hash-entry file inode ange-ftp-inodes-hashtable)) (list (if (and (stringp dirp) (file-name-absolute-p dirp)) (ange-ftp-expand-symlink dirp (file-name-directory file)) @@ -3309,12 +3321,7 @@ system TYPE.") (concat (if (stringp dirp) "l" (if dirp "d" "-")) "?????????") ;8 mode nil ;9 gid weird - ;; Hack to give remote files a unique "inode number". - ;; It's actually the sum of the characters in its name. - (apply '+ (nconc (mapcar 'identity host) - (mapcar 'identity user) - (mapcar 'identity - (directory-file-name name)))) + inode ;10 "inode number". -1 ;11 device number [v19 only] )))) (ange-ftp-real-file-attributes file)))) |