From: Christian Johansson <christian@cvj.se>
To: 30533@debbugs.gnu.org
Subject: bug#30533: 26.0.60; (copy-file) over TRAMP FTP mistakes file for directory
Date: Wed, 21 Feb 2018 07:13:21 +0100 [thread overview]
Message-ID: <f1ef5afe-d2b4-7350-e35b-74c420010908@cvj.se> (raw)
In-Reply-To: <121b6c23-1806-2d06-17df-0ccc1cfa99c5@cvj.se>
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@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@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@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@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))))
next prev parent reply other threads:[~2018-02-21 6:13 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 [this message]
2018-02-21 13:31 ` Michael Albinus
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f1ef5afe-d2b4-7350-e35b-74c420010908@cvj.se \
--to=christian@cvj.se \
--cc=30533@debbugs.gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.