If I run a command with ofSystem, I can’t see how to get the result back into OF.
Bright ideas welcome
TIA
If I run a command with ofSystem, I can’t see how to get the result back into OF.
Bright ideas welcome
TIA
ofSystem returns a string with the output from the called command
Thanks - I know it prints to cout, but I can’t see a method that lets you put it in a string in OF.
string result = ofSystem("ls");
should work
No - this does nothing. The string always has a length of 1, but should be at least 16.
The console shows the correct listing though.
Of course
string result = (“Test…”);
and print to screen works perfectly.
Suggested
string result = ofSystem("ls");
Works here fine. I’m on OSX
I think it is Xcode being cranky - the result would appear in the Xcode console as if Xcode was
sucking up all output from the shell program.
Deleted prefs, restarted computer and it seems to be ok… for now.