In article <[EMAIL PROTECTED]>, "Luigi" <[EMAIL PROTECTED]> wrote:
> The question is that I have a C program (by third part) that streams > the logs into the stderr and stdout devices. I need to create an > envelopment that captures the outputs and puts them in a file > generating log events (for a real-time view). As suggested in another followup, the C program's output will probably be "block buffered" when its output is a pipe. In this case, you'll get output only when the buffer is full, or when the program exits. If the program can be modified, it only needs to flush stdout after each output event. Otherwise, you need to use a device that looks like a tty, just so the C stdio library will switch to line buffering as it generally does with terminals. This is called a pseudotty. It's a little more difficult to use than a pipe, but you can probably get something going with openpty or forkpty from the os/posix module, or there may still be 3rd party packages for this. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list