I am not sure if this is a standard C function. I need to run under Linux Solution.
Popen is the standard configuration of modern unix and unix-like operating systems, and Linux is one of them:-)
Type
man popen
Read more related information in the terminal.
Edit
popen Whether to generate one-way or two-way pipes depends on the implementation. In Linux and OpenBSD, popen generates one-way pipes, which are read-only or write-only. On OS X, FreeBSD and NetBSD, popen produces two-way pipes.
How should I run another program from my C program? I need to be able to write data to the STDIN of the started program (and possibly read from its STDOUT)
I am not sure if this is a standard C function. I need to run under Linux The solution.
You want to use popen. It provides you with a one-way pipe, you can use it to access the program’s stdin and stdout. < p>
Popen is the standard configuration of modern unix and unix-like operating systems, and Linux is one of them:-)
Type
man popen
Read more information in the terminal.
Edit
Whether popen generates one-way or two-way pipes depends on the implementation. In Linux and OpenBSD, popen generates one-way pipes, which are read-only or write-only. On OS X, FreeBSD and NetBSD, popen produces two-way pipes.