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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dired command on same host


From: Michael Albinus
Subject: Re: Dired command on same host
Date: Tue, 04 Jan 2022 13:56:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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 via email to

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