summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2008-06-28 10:16:37 +0000
committerMichael Albinus <michael.albinus@gmx.de>2008-06-28 10:16:37 +0000
commitd9217eea8de50358cc612ef36cab3dbe078e5c3d (patch)
treee945375044ebc85f2bffc33c675b7b25ae49c6e6 /lisp/net
parentfa4eb5477933582b488e24c4ef817be8a0017f09 (diff)
downloademacs-d9217eea8de50358cc612ef36cab3dbe078e5c3d.tar.gz
* net/tramp.el (tramp-handle-file-modes): Handle symlinks.
(tramp-convert-file-attributes): Convert symlinks only when returned from `tramp-handle-file-attributes-with-stat'.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 6dd76abc610..5431290da52 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2675,9 +2675,9 @@ and gid of the corresponding user is taken. Both parameters must be integers."
(defun tramp-handle-file-modes (filename)
"Like `file-modes' for Tramp files."
- (when (file-exists-p filename)
- (tramp-mode-string-to-int
- (nth 8 (file-attributes filename)))))
+ (let ((truename (or (file-truename filename) filename)))
+ (when (file-exists-p truename)
+ (tramp-mode-string-to-int (nth 8 (file-attributes truename))))))
(defun tramp-handle-file-directory-p (filename)
"Like `file-directory-p' for Tramp files."
@@ -6627,9 +6627,11 @@ Return ATTR."
(unless (stringp (nth 8 attr))
(setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr))))
;; Convert directory indication bit.
- (if (string-match "^d" (nth 8 attr))
- (setcar attr t)
- (if (and (listp (car attr)) (stringp (caar attr))
+ (when (string-match "^d" (nth 8 attr))
+ (setcar attr t))
+ ;; Convert symlink from `tramp-handle-file-attributes-with-stat'.
+ (when (consp (car attr))
+ (if (and (stringp (caar attr))
(string-match ".+ -> .\\(.+\\)." (caar attr)))
(setcar attr (match-string 1 (caar attr)))
(setcar attr nil)))