If my .NET client uses System.IO.File.Copy to copy a file from \\server1\\share1\\file1.txt to \\sever1\\share2\\file2.txt
This is an old question, but I don't think there is a correct answer here.
There are in fact 2 questions (3 questions, but the 3rd is redundant).
The first question is if a .Net process running on a (3rd) client machine copies a file from one network share to another network share, does it makes a difference if the source and target shares are on the same computer (different from the client) vs 2 different computers? The answer is clearly not. There is no mechanism, no secret tunnel between network shares. Data has to travel to the client and then to the other share. It does not make a difference if the operation is a copy or a move, and it actually does not make a difference if the shares are on the same computer as the client (and you really access folders as network shares with a UNC path and not as local folders).
The 2nd question is, how can this round-trip be avoided? Here are some suggestions:
That is an excellent question - I can't seem to find any definitive answer so perhaps the best thing would be to fire up Wireshark for a test.
If it's possible to do a move instead of a copy, that should happen instantly. Otherwise you need to put a service on the target machine so you can call it remotely.
Yes it does. I can say this from personal experience with copying 10 GB Zip files between machines. The "client" machine was on a different coast of America than the two other machines. Between the two machines directly from one of them took a reasonable amount of time. Trying to initiate the copy from the machine on the other coast took ~10 hours :(
The file contents must go through the machine performing the Copy operation. The only way around this is to run programs on the target machine(s) that perform the transfer without the client machine in the middle. such as FXP which uses FTP to transfer server to server.
However, opening up this pathway may also open a security loophole and I suspect many admins would be reluctant to allow this.