[Solved] Can I issue command line prompts and read the output with the OF app?

#1

I know I can use system() or ofSystem() to issue command line prompts on OSX and Windows, but is there any way to read the output of the command inside the OF app?

For instance, running a command line tool and reading the text it outputs:

$ ./zxing --more 2019_07_01_15_54_42.jpg
  Format: QR_CODE
  Point[0]: 320 6253.25
  Point[1]: 318.5 5814
  Point[2]: 767.5 5795.5
0
#2

Found the solution here. This works on MacOS and Windows 10:

string result = ofSystem("ls");

Also, a possible workaround is running a command and writing its output to a text file and then reading that text file:

ofSystem("ls > output.txt");