GNU bug report logs -
#30533
26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
Previous Next
Full log
Message #14 received at 30533 <at> debbugs.gnu.org (full text, mbox):
Christian Johansson <christian <at> mediastrategi.se> 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.
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.