You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2001/06/15 06:03:05 UTC

Re: Getting unbuffered output from a subprocess

On Tue, 27 Mar 2001, Andrew Ho wrote:

> Hello,
> 
> So, when doing a CGI and needing to execute a subprocess with input based
> on user input, I always do a open()-fork()-exec() like so:
... 
> When using a mod_perl script, I "use Apache::SubProcess" and the above
> stuff still works. However, let's say the subprocess I kicked off takes a
> while to process, but prints status information in the meantime (for
> example, tagging a big CVS tree, or indexing textfiles, or whatnot). I
> want the user to see the information "real-time" (so I'd probably have
> local $| = 1 inside the if($pid) block above).
> 
> This no longer works under Apache::SubProcess. Tt buffers up all the
> output and then sends it all at once. So my parent process reads in an
> unbuffered way, but the child "exec()" outputs all at once.

can you post a small test case using Apache::SubProcess?  that'll make it
easier to see whats going on.