[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp (2.0.29); erroneous error message: File is a symlink to a none

From: Michael Albinus
Subject: Re: tramp (2.0.29); erroneous error message: File is a symlink to a nonexistent target
Date: Sat, 05 Apr 2003 15:28:33 +0200
User-agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/21.2 (gnu/linux)

Michael Albinus <address@hidden> writes:

> For me, everything is fine now except the case of a symlink to a
> symlink to a directory on a remote host, which should be a rare case.

With the patch below (instead of the one I've posted last night) even
this works now for me:

home/albinus> diff -u ange-ftp.el.orig ange-ftp.el
--- ange-ftp.el.orig    Fri Apr  4 23:32:20 2003
+++ ange-ftp.el Sat Apr  5 15:02:57 2003
@@ -3356,9 +3356,14 @@
       (ange-ftp-real-insert-file-contents filename visit beg end replace))))
 (defun ange-ftp-expand-symlink (file dir)
-  (if (file-name-absolute-p file)
-      (ange-ftp-replace-name-component dir file)
-    (expand-file-name file dir)))
+  (let ((res (if (file-name-absolute-p file)
+                (ange-ftp-replace-name-component dir file)
+              (expand-file-name file dir))))
+    (if (file-symlink-p res)
+       (ange-ftp-expand-symlink
+        (ange-ftp-get-file-entry res)
+        (file-name-directory (directory-file-name res)))
+      res)))
 (defun ange-ftp-file-symlink-p (file)
   ;; call ange-ftp-expand-file-name rather than the normal
@@ -3370,11 +3375,8 @@
              (ange-ftp-get-file-part file)
              (ange-ftp-get-files (file-name-directory file)))))
-       (if (stringp file-ent)
-           (if (file-name-absolute-p file-ent)
-               (ange-ftp-replace-name-component
-                (file-name-directory file) file-ent)
-             file-ent)))
+       (and (stringp file-ent)
+            file-ent))
     (ange-ftp-real-file-symlink-p file)))
 (defun ange-ftp-file-exists-p (name)

> Kai: could you, please, verify this, and commit the ange-ftp patch to
> CVS if you agree?

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]