Gtk::Gdk::input_add and CPU racing



Hello,

I am new here and I was hoping for some help.  Thanks in advance.

I am working input_add to try to monitor the status of an external
command.

I use this code(simplified here):
#########################################
open(LS, "ls 2>&1 |");
$text->Gtk::Gdk::input_add(fileno(LS),['read'],\&list);

sub list{
        while(<LS>)
        { $text->insert( $font, undef, undef, $_ );}
}
##########################################

My problem is when the command is done my cpu starts to race.  I am not
sure where or how to close the IO.

Any help here would sure be appreciated.  

Thanks 
Dave

-- 
David <heygus hotpop com>



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