Re: Glib::IO->add_watch



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

Regards

Jeff

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]