aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus2008-06-28 10:17:22 +0000
committerMichael Albinus2008-06-28 10:17:22 +0000
commit5da241082ecbe0992c0bf3a2021137d4b27a5e2a (patch)
tree5dcc88f3ca03493b7798f273b6336946cb6e73f3 /lisp/net
parent2d8b5d77c1fa8e257b3d1b56a1d47e88d782a67a (diff)
downloademacs-5da241082ecbe0992c0bf3a2021137d4b27a5e2a.tar.gz
emacs-5da241082ecbe0992c0bf3a2021137d4b27a5e2a.zip
* 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."
2675 2675
2676(defun tramp-handle-file-modes (filename) 2676(defun tramp-handle-file-modes (filename)
2677 "Like `file-modes' for Tramp files." 2677 "Like `file-modes' for Tramp files."
2678 (when (file-exists-p filename) 2678 (let ((truename (or (file-truename filename) filename)))
2679 (tramp-mode-string-to-int 2679 (when (file-exists-p truename)
2680 (nth 8 (file-attributes filename))))) 2680 (tramp-mode-string-to-int (nth 8 (file-attributes truename))))))
2681 2681
2682(defun tramp-handle-file-directory-p (filename) 2682(defun tramp-handle-file-directory-p (filename)
2683 "Like `file-directory-p' for Tramp files." 2683 "Like `file-directory-p' for Tramp files."
@@ -6627,9 +6627,11 @@ Return ATTR."
6627 (unless (stringp (nth 8 attr)) 6627 (unless (stringp (nth 8 attr))
6628 (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr)))) 6628 (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr))))
6629 ;; Convert directory indication bit. 6629 ;; Convert directory indication bit.
6630 (if (string-match "^d" (nth 8 attr)) 6630 (when (string-match "^d" (nth 8 attr))
6631 (setcar attr t) 6631 (setcar attr t))
6632 (if (and (listp (car attr)) (stringp (caar attr)) 6632 ;; Convert symlink from `tramp-handle-file-attributes-with-stat'.
6633 (when (consp (car attr))
6634 (if (and (stringp (caar attr))
6633 (string-match ".+ -> .\\(.+\\)." (caar attr))) 6635 (string-match ".+ -> .\\(.+\\)." (caar attr)))
6634 (setcar attr (match-string 1 (caar attr))) 6636 (setcar attr (match-string 1 (caar attr)))
6635 (setcar attr nil))) 6637 (setcar attr nil)))