[Top][All Lists]

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

bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directo

From: Christian Johansson
Subject: bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
Date: Thu, 22 Feb 2018 06:11:13 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Hi Michael!

Your fix fixed one of the issues. (file-regular-p) now works as expected over TRAMP ftp.

I can't reproduce the other one right now. There must be some kind of cache influencing the other issue.. I deleted the tramp directory but it had no effect.. I'll make a new report if I find a way to reproduce the other issue.


On 2018-02-21 14:31, Michael Albinus wrote:
Christian Johansson <address@hidden> writes:

Hi Christian,

Here are two cases that display different tramp errors related to
copy-file, but only if you don't open the remote path using dired-mode
Got it. In fact, ange-ftp has no file-regular-p implementation. I've
added this, could you, pls, test:

diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index e62bee4499..a267fc6448 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -3373,6 +3373,13 @@ ange-ftp-file-symlink-p
 	(file-error nil))
     (ange-ftp-real-file-symlink-p file)))
+(defun ange-ftp-file-regular-p (file)
+  ;; Reuse Tramp's implementation.
+  (if (ange-ftp-ftp-name file)
+      (and (file-exists-p file)
+       (eq ?- (aref (file-attribute-modes (file-attributes file)) 0)))
+    (ange-ftp-real-file-regular-p file)))
 (defun ange-ftp-file-exists-p (name)
   (setq name (expand-file-name name))
   (if (ange-ftp-ftp-name name)
@@ -4389,6 +4396,7 @@ ange-ftp-hook-function
 (put 'file-readable-p 'ange-ftp 'ange-ftp-file-readable-p)
 (put 'file-executable-p 'ange-ftp 'ange-ftp-file-executable-p)
 (put 'file-symlink-p 'ange-ftp 'ange-ftp-file-symlink-p)
+(put 'file-regular-p 'ange-ftp 'ange-ftp-file-regular-p)
 (put 'delete-file 'ange-ftp 'ange-ftp-delete-file)
 (put 'verify-visited-file-modtime 'ange-ftp
@@ -4477,6 +4485,8 @@ ange-ftp-real-file-executable-p
   (ange-ftp-run-real-handler 'file-executable-p args))
 (defun ange-ftp-real-file-symlink-p (&rest args)
   (ange-ftp-run-real-handler 'file-symlink-p args))
+(defun ange-ftp-real-file-regular-p (&rest args)
+  (ange-ftp-run-real-handler 'file-regular-p args))
 (defun ange-ftp-real-delete-file (&rest args)
   (ange-ftp-run-real-handler 'delete-file args))
 (defun ange-ftp-real-verify-visited-file-modtime (&rest args)

Best regards, Michael.

reply via email to

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