Re: Glib::IO watcher unbuffered? [SOLUTION]
- From: zentara <zentara1 sbcglobal net>
- To: gtk-perl-list gnome org
- Subject: Re: Glib::IO watcher unbuffered? [SOLUTION]
- Date: Mon, 22 Jan 2007 14:29:24 -0500
On Mon, 22 Jan 2007 06:19:58 +0100
"Philipp E. Letschert" <phil uni-koblenz de> wrote:
I would like to have unbuffered output processing from an external command
(command prints a line, sleeps, prints a line, sleeps ...):
It is common behaviour that the C library uses isatty(3) to decide if stdout
is line-buffered or block-buffered. When reading from a pipe to an external
command the output is block-buffered, which explains the reported behaviour.
Solution is using a pseudo-terminal and connect the watcher to it, following is
a complete example:
use Glib;
use IO::Pty;
HTH, Phil
Thanks for posting that, its a gem. :-)
zentara
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]