GNU bug report logs -
#30533
26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
Previous Next
Full log
View this message in rfc822 format
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.
;; Case 1
(let ((remote-path "/ftp:anonymous <at> speedtest.tele2.net:/1KB.zip")
(local-path "~/Downloads/1KB.zip"))
(if (file-directory-p remote-path)
(progn
(message "File %s is a directory" remote-path)
(copy-directory remote-path local-path t t t))
(progn
(message "File %s is not a directory" remote-path)
(copy-file remote-path local-path t t t t))))
;; Case 2
(let ((remote-path "/ftp:anonymous <at> speedtest.tele2.net:/1KB.zip")
(local-path "~/Downloads/1KB.zip"))
(if (file-regular-p remote-path)
(progn
(message "File %s is a regular file" remote-path)
(copy-file remote-path local-path t t t t))
(progn
(message "File %s is not a regular file" remote-path)
(copy-directory remote-path local-path t t t))))
If I first open the path in dired mode
(/ftp:anonymous <at> speedtest.tele2.net) then the operations work as
expected. It seems that tramp stores information about remote
file-system when accessing it in dired-mode.
Even after restarting the problem seems to be gone when the remote path
has been opened once in dired-mode. Is there some cache to this?
On 2018-02-20 16:49, Christian Johansson wrote:
> (let ((remote-path "/ftp:anonymous <at> speedtest.tele2.net:/1KB.zip")
> (local-path "~/Downloads/1KB.zip"))
> (if (file-regular-p remote-path)
> (progn
> (message "File %s is a regular file" remote-path)
> (copy-file remote-path local-path t t t t))
> (progn
> (message "File %s is a directory" remote-path)
> (copy-directory remote-path local-path t t t))))
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.