08-15-2014 09:57 PM
I want to run the <apm> command, from withing a C program, and get the program to receive the output - so that I can display it in an xsession (window) on my screen.
I've used the <system> call to tell the O/S what to do - but I don't know where to look to find out how to issue a system call and have the program receive the output.
Any ideas are appreciated.
Solved! Go to Solution.
08-16-2014 01:34 AM
The correct function is popen(3) with the "r" parm. Or you could use pipe(2) with fork(2)/exec(2).
And example of the reverse popen(3) is here:
08-16-2014 04:03 PM
All I needed was the <popen> function.
Worked as expected.
Now I can re-write all the programs that I wrote that use [system abcdefg >> output] and then do an <open> of "output".
The link you left was a bonus!
Thank you for your help!