unix popen(), , FILE* .
unix pipe(), fork(), exec(), select() read() wait() / .
popen fork pipe . , stdout ( ). , , , stderr stdin.
In the windows, see type calls CreatePipe()and CreateProcess(), in doing so, the IO members STARTUPINFOare set into your channels. You can get a file descriptor to do read()with the help of a _open_ofshandle()process descriptor. Depending on the application, you may need to read multithreading, or it might be normal to block.
source
share