From: Daniel Milde <daniel@mi...> - 2012-04-26 09:01:03
I just found out that SSHFS moves files from server to host when I run
copy command. According to FAG it shouldn't:
sshfs host: data
time cp etc.tgz etc1.tgz
The file etc.tgz has about 50MB and it takes 2.673s when I run the same
command directly via SSH.
Is this bug or feature?
From: Mike Kelly <mike@pa...> - 2012-04-26 15:36:45
On Thu 26 Apr 2012 04:42:33 AM EDT, Daniel Milde wrote:
> Hello Miklos,
> I just found out that SSHFS moves files from server to host when I run
> copy command. According to FAG it shouldn't:
I'd think the FAQ is just incomplete there. A move shouldn't have to
move any data "over the wire", but a copy would. The cp command doesn't
have a system call it uses to make the copy. It just opens the old file
for reading, the new file for writing, and writes the data. The mv
command, though, can use the rename(2) command when staying on the same
filesystem, and that is implemented in sshfs, so that it's done on the
remote end, without having to read all the data.