GNU bug report logs - #30533
26.0.60; (copy-file) over TRAMP FTP mistakes file for directory

Previous Next

Package: emacs;

Reported by: Christian Johansson <christian <at> mediastrategi.se>

Date: Mon, 19 Feb 2018 17:29:01 UTC

Severity: normal

Found in version 26.0.60

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 30533 <at> debbugs.gnu.org (full text, mbox):

From: Christian Johansson <christian <at> cvj.se>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 30533 <at> debbugs.gnu.org
Subject: Re: bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for
 directory
Date: Thu, 22 Feb 2018 06:11:13 +0100
[Message part 1 (text/plain, inline)]
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.

Regards
Christian


On 2018-02-21 14:31, Michael Albinus wrote:
> Christian Johansson <christian <at> 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:
>
>
>
> 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)
>
>
> Best regards, Michael.

[Message part 2 (text/html, inline)]

This bug report was last modified 7 years and 92 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.