[Chicago] capturing output from subprocesses

David Rock david at graniteweb.com
Tue Nov 8 21:34:21 CET 2005


* Martin Maney <maney at two14.net> [2005-11-08 14:17]:
> On Tue, Nov 08, 2005 at 12:40:04PM -0600, Ian Bicking wrote:
> > Noel Thomas Taylor wrote:
> > > Do you have any thoughts about recapturing the output of an aborted child 
> > > process before the memory that is buffering its output gets blown away?
> > 
> > Since it is OS buffering, shouldn't the OS handle that for you?  I don't 
> > know; I would suggest starting with a test, then finding something that 
> > passes that test.
> 
> Ah, but that's just it - it's NOT the OS that's doing the bufferring. 
> C's standard IO library uses bufferred IO for efficency - it's much
> faster than doing a system call for every character.  Back in the old
> days the buffer was often only 512 bytes, but I'm sure that modern
> library implementations will allocate a larger buffer by default.

I thought there was a way to manually flush the buffer.  I can't think of
what it is offhand, though.

-- 
David Rock
david at graniteweb.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.python.org/pipermail/chicago/attachments/20051108/7f95236d/attachment.pgp


More information about the Chicago mailing list