tags:

views:

37

answers:

2

I have my local computer and I also have a remote computer. I want to make a C program that moves a file or folder to that remote computer. How can I do this in C? Or is this only possible though Terminal commands?

A: 

Of course that is perfectly possible in C. You could write a server process running on one of the computers, listening for incoming network connections, a client process to connect that server and define a protocol how to transfer files. But most probably, you would want to use library implementing some protocol like the scp protocol or http.

For a simple application, the easiest way to get going might be calling scp via the system() function (which is also available if you are not on Linux). If you are on Windows, using some library might be easier because there is no scp by default.

Sven Marnach
+4  A: 

Depending on how complex your requirements are, you could use libssh (LGPL, used in various ssh clients), investigate modifying dropbear (MIT), or quick 'n dirty:

system("scp myfile host:/some/path/to/file");
SimonJ