unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Manuel Giraud <manuel@ledu-giraud.fr>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Dired command on same host
Date: Tue, 04 Jan 2022 13:56:37 +0100	[thread overview]
Message-ID: <87czl77j7e.fsf@gmx.de> (raw)
In-Reply-To: <877dbf94su.fsf@elite.giraud> (Manuel Giraud's message of "Tue, 04 Jan 2022 11:24:49 +0100")

Manuel Giraud <manuel@ledu-giraud.fr> writes:

> Hi,

Hi Manuel,

> I'm happily using dired and tramp with `dired-dwim-target' set to t. So
> when I'm in this frame configuration:
>
> +-------------+-------------+
> |             |             |
> | some dired  | other dired |
> | on host A   | on host A   |
> |             |             |
> |             |             |
> |             |             |
> |             |             |
> +-------------+-------------+
>
> I can, for example, copy some files from one directory to another. But
> when I do this, tramp copy the file over ssh to my local /tmp before
> copying it back to the other directory. It can be a problem when the
> file is too big. Is it possible for tramp to detect that this is the
> same host and just make a simple cp on host A?

Tramp tries this if possible. See the function tramp-do-copy-or-rename-file,
which calls tramp-do-copy-or-rename-file-directly. This happens in two
cases:

- Both files are on the same (remote) host.

- One file is local, and the other one matches the function
  tramp-local-host-p. Likely, the crucial point here is that either the
  local or the remote user must be root.

> Same question for two different hosts: Is it possible to make tramp do a
> scp from host A to host B directly?

Not (yet). See the TODO section at the end of tramp-sh.el:

;; * Optimize out-of-band copying when both methods are scp-like (not rsync).

Best regards, Michael.



  reply	other threads:[~2022-01-04 12:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 10:24 Dired command on same host Manuel Giraud
2022-01-04 12:56 ` Michael Albinus [this message]
2022-01-04 16:25   ` Manuel Giraud
2022-01-04 18:33     ` Michael Albinus
2022-01-04 19:35       ` Tassilo Horn
2022-01-05  9:35         ` Manuel Giraud
2022-01-05 21:07           ` Tomas Hlavaty
2022-01-06 11:01             ` Michael Albinus
2022-01-07 15:50               ` Michael Albinus
2022-01-10  9:33                 ` Manuel Giraud
2022-01-10 12:56                   ` Michael Albinus
2022-01-10 14:07                     ` Manuel Giraud
2022-01-10 15:00                       ` Michael Albinus
2022-01-10 16:16                         ` Manuel Giraud
2022-01-11  8:25                           ` Michael Albinus
2022-01-11  8:59                             ` Manuel Giraud
2022-01-11  9:10                               ` Michael Albinus
2022-01-10 17:21                         ` Yuri Khan
2022-01-11  8:29                           ` Michael Albinus
2022-01-05 10:34         ` Michael Albinus
2022-01-05 13:02           ` Manuel Giraud
2022-01-05 14:37             ` Michael Albinus
2022-01-05 18:23               ` Manuel Giraud
2022-01-05  9:44       ` Manuel Giraud
2022-01-05 10:40         ` Michael Albinus
2022-01-05 11:08           ` Yuri Khan
2022-01-05 11:46             ` Michael Albinus
2022-01-05 19:55           ` Tassilo Horn

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czl77j7e.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=manuel@ledu-giraud.fr \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).