bug-gnu-emacs
[Top][All Lists]
Advanced

[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: Michael Albinus
Subject: bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
Date: Tue, 20 Feb 2018 16:06:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux)

Christian Johansson <address@hidden> writes:

Hi Chrsitian,

> I have a case where Emacs have trouble understanding whether a remote
> file is a file or a directory, I run this code where PATH-LOCAL is on
> localhost and PATH-REMOTE is on a remote FTP via TRAMP
>
> (let ((file-or-directory (not (file-directory-p path-remote))))
>     (if file-or-directory
>         (progn
>           (message "Downloading file '%s' to '%s'.. (synchronously)" 
> path-remote path-local)
>           (copy-file path-remote path-local t t t t)
>           (message "Download of file '%s' finished. (synchronously)" 
> path-local))
>       (progn
>         (message "Downloading directory '%s' to '%s'.. (synchronously)" 
> path-remote path-local)
>         (copy-directory path-remote path-local t t t)
>         (message "Download of directory '%s' finished. (synchronously)"
>     path-local))))
>
> The file .error-log will be transferred locally to .error-log/.error-log
> instead of .error-log. The filename does not matter.
>
> It seems (file-regular-p) mistakes remote files over TRAMP FTP more
> often than (file-directory-p). Maybe that is the cause of this problem.

I have problems in reproducing the scenario. Coul you, pls, give
examples of PATH-LOCAL and PATH-REMOTE?

It is also important to know, whether PATH-LOCAL is an existing file or
directory. Also, in case of a directory, it is important to know,
whether the string PATH_LOCAL has a trailing slash.

Thanks, and best regards, Michael.





reply via email to

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