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?
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:
using namespace std;
FILE *fp = popen("ls /", "r+" );
while (fp != NULL)
while ( fgets( buff, sizeof buff, fp ) != NULL )
cout << buff;
cin.getline(command, sizeof command);
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?