call command line application and read output


I would like to launch a CLI application and read what it outputs.
I can launch the app using system() but don’t know how to read it’s output.

How do you read the output of an CLI application launched from an oF app ?

You will have to use the standart C++ way, there is not such OF functionality.

Look here: and here:

there’s actually an OF function to do that: ofSystem(“command”)

Thank you both for the input.

I’ve tested both methods, and both returned the same results.

The issue I have now is that I only get the first few lines of the output, not the full output.
Any hints on how to deal with that ?

Thank you,