ssh in OF application

Hi,
i tried to search OF app that uses ssh to communicate with another laptop but no luck.
What I wanna do is simply connect to remote server, copy my file to the remote server, execute a command and parse a string back to my laptop. It’s something I do in terminal but now I want it to run when my OF app runs and uses the string from server. has anyone done something similar? or alternative solution?
Thanks

Sorry for cross posting, I posted originally in basic.

If you’re on Linux/OSX you can use popen() http://developer.apple.com/library/mac/#documentation/darwin/reference/manpages/man3/popen.3.html

A really simple example would be like:

  
#include <iostream>  
#include <stdio.h>  
//#include <conio.h>  
#include <string>  
#include <sstream>  
#include <iostream>  
  
using namespace std;  
  
int main()  
{  
	  
	FILE *fp = popen("ls /", "r+" );  
	char buff[50];  
	char command[50];  
	  
	while (fp != NULL)  
	{  
		while ( fgets( buff, sizeof buff, fp ) != NULL )   
		{  
			cout << buff;  
		}  
		cin.getline(command, sizeof command);  
		fputs(command, fp);  
	}  
	pclose( fp );  
	  
}  

I think you can keep that File pointer around as long as you’d like and read it whenever you need to.

Thanks, it’s really helpful.
And I have a bit further question, is there a way to deal with the ssh password prompt?

You can have passwordless ssh - http://blogs.translucentcode.org/mick/archives/000230.html