On Thu, Apr 4, 2019 at 6:45 AM Jeff via gtk-perl-list <gtk-perl-list@gnome.org> wrote: > > On 03/04/2019 00:35, Daniel Kasak via gtk-perl-list wrote: > > Hi all. I'm trying to adapt some code I have for tailing the output of > > an app. When I fork using open() ... things work ( I have some issues > > with tail never exiting, but that's to be expected ). When I open a > > filehandle for reading these redirected log files however, my callback > > I passed to add_watch() gets called in a busy loop, and nothing else > > happens. I assume I'm just doing something simple wrong? What is that > > thing? :) Thanks ... > > The _watch_cmd() sub in gscan2pdf does what you want - uses > Glib::IO->add_watch() on stdout and stderr and triggers a callback on > every line read: > > https://sourceforge.net/p/gscan2pdf/code/ci/master/tree/lib/Gscan2pdf/Frontend/CLI.pm#l504
Thanks for the response Jeff ... but the example you linked is very similar to what I have ( in another codebase ) that works. ie I don't have problems with this method when *forking* a process - it works really well. I have problems with this method when I want to tail ( or use Glib::IO->add_watch() on ) STDOUT & STDERR of the *current* process. Dan _______________________________________________ gtk-perl-list mailing list gtk-perl-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-perl-list