From: Michael Albinus <michael.albinus@gmx.de>
To: Christian Johansson <christian@cvj.se>
Cc: 30533@debbugs.gnu.org
Subject: bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
Date: Wed, 21 Feb 2018 14:31:26 +0100 [thread overview]
Message-ID: <87k1v6cvv5.fsf@gmx.de> (raw)
In-Reply-To: <f1ef5afe-d2b4-7350-e35b-74c420010908@cvj.se> (Christian Johansson's message of "Wed, 21 Feb 2018 07:13:21 +0100")
[-- Attachment #1: Type: text/plain, Size: 318 bytes --]
Christian Johansson <christian@cvj.se> 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
> first.
Got it. In fact, ange-ftp has no file-regular-p implementation. I've
added this, could you, pls, test:
[-- Attachment #2: Type: text/plain, Size: 1528 bytes --]
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
'ange-ftp-verify-visited-file-modtime)
@@ -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)
[-- Attachment #3: Type: text/plain, Size: 24 bytes --]
Best regards, Michael.
next prev parent reply other threads:[~2018-02-21 13:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 8:18 bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory Christian Johansson
2018-02-19 17:50 ` Glenn Morris
2018-02-20 5:04 ` Christian Johansson
2018-02-20 11:02 ` Christian Johansson
2018-02-20 15:49 ` Christian Johansson
2018-02-21 6:13 ` Christian Johansson
2018-02-21 13:31 ` Michael Albinus [this message]
2018-02-21 16:51 ` Christian Johansson
2018-02-21 17:05 ` Michael Albinus
2018-02-22 5:11 ` Christian Johansson
2018-02-22 10:50 ` Michael Albinus
2018-02-20 15:06 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k1v6cvv5.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=30533@debbugs.gnu.org \
--cc=christian@cvj.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).