CGI-like external program invocation

CGI-like external program invocation

Post by Metaos » Fri, 10 Feb 2006 21:12:58


Hi,

In C++ program, how can I execute external program and bind stdio, just
like how web server calls a CGI program?


Thanks,
--
Metaosp
 
 
 

CGI-like external program invocation

Post by Robert Har » Fri, 10 Feb 2006 21:25:29


In C you use popen

Robert

 
 
 

CGI-like external program invocation

Post by metaos » Sun, 12 Feb 2006 19:16:08


It seems that popen can either write to or read from external program
but not both, but I do need the bi-directional IO. Is there any other
way? A CGI program can get form post data from stdin and write output to
stdout, could somebody tell me how a does typical web server like apache
achieve this?

Metaosp