Re: redirecting output for a spawned child process..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



bruce wrote:

> hi...
> 
> got a situation where i have a parent app that spawns children. trying
> to figure out how to get the output of the spawned/forked children to
> be written to an external file...

Normally I would use freopen() on stdout and stderr, but that's not
available in PHP :-(

> can't seem to find any examples of how to accomplish this... do i have
> to insert something within the child php app itself to redirect the
> output that's currently being sent to the term? i'd prefer to have the
> output displayed, as well as redirected...

You basically need to do something about the stdin, stdout and stderr
file descriptors that your child inherited from the parent at time of
fork().  I can't seem to find many PHP functions that deal with file
descriptors though. 



-- 
Per Jessen, Zürich (2.6°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux