How can I copy a large file from one host to another host using socket
under unix environment?
What kind of system calls do I have to use?
I'd appreciate it if you could give me a short description. Thank you
I recommend that you install and use the program SSH server on the remote
machine and install and execute the standalone program scp on the machine
from where you want to copy from. You can even start this program
programmatically using the Perl function system or C function fork/exec or
C function system.
If I were in your place I would not bother too much with the overhead
caused by executing a new process because this is going to be a huge file
copy anyway. It just does not happen frequently and is slow anyway. (In
some very special situation that may not be true on a LAN using GigaBit
Ethernet, but I assume this is not your case.)
You can also use Perl and the module NET::Ftp to put a file on a remote
machine, but that is NOT secure, the communication and the password can be
BTW: eventually all these programs use sockets.
[ back to toc ]