Re: Get the complete output of a program/command
- Posted by irv Dec 02, 2017
- 1196 views
TheDcoder said...
... but I am not sure how I can wait until the process ends... so really my question is "how to wait until a process ends" ...
system_exec() returns an error code - therefore it must wait until the process it calls ends.
And, since the process is finished, you can just dump the output to a file, and use it:
include std/io.e include std/console.e system_exec("ls -la > lsoutput") object results = read_file("lsoutput",TEXT_MODE) display(results)