Re: fileevent
- From: alazar <alazar@xxxxxxxxxxxxxx>
- Date: Fri, 21 Jul 2006 10:27:04 -0400
Thanks for all your help. Turns out to have been a typo on my part,.
Had I had -w turned on then it would not have been a problem in the
first place.
Couple of other things.
1. I'm tailing a file and using fileevent to read the file w/ the call
back. When you do this, under the covers Perl/Tk uses select to handle
the IO and the widget events. It's actually pretty cool. I did a strace
on my perl prog and saw an enless loop of read events on my pipe file
descriptor and none on the X socket file descriptor. That is what lead
me to look into why the file was always ready for reading. Turns out
that I had a typo in my read statment and was not really looking at the
open file. Stupid mistake, cool, fun, edumacational, and somewhat
satisfying debugging process. I had not done this w/ perl before and
thought i was missing something obvious.
2. $mw->update was the other thing i was looking for, thinking I'd need
to manually update the window. Thanks for that.
bob
Jack D wrote:
"alazar" <alazar@xxxxxxxxxxxxxx> wrote in message.
news:e9o6si$fno$1@xxxxxxxxxxxxxxxxxxxx
more info
Doin an strace on the perl run and the select is repeatedly returning
that the pipe is ready to read when there is no data to read (the file
has not been appended to and the callback that does a read does not read
any data). the select never returns the socket for the X events ready.
tia
alazar wrote:
I must be missing something.
I have a script that reads a tailed file via a pipe, and then processes
it and puts up the info in a HLIST window. The problem is that I never
see the window. I know that the callback is being called from the
debugging statements. If I just read the file w/o the tail the
structures are loaded properly. It's as if the script is spending all
it's time servicing the fileevent and never actually processing the
other objects.
Suggestions?
You originally state that you are "tail"ing a file via pipe - next you say
the you are using select on a socket. Which is it?
I thought Marc's suggestion was a good one :-) sample script? Platform? Have
you also searched for "fileevent" and "tail" in Google groups?
If it is a GUI problem - You can always try $mw->update to refresh your GUI
whenever you want.
Jack
- References:
- fileevent
- From: alazar
- Re: fileevent
- From: alazar
- Re: fileevent
- From: Jack D
- fileevent
- Prev by Date: Tk::send & Tk::Receive - without Tk?
- Next by Date: Re: OT - the empty set and strict and warnings
- Previous by thread: Re: fileevent
- Next by thread: what is good plot module for ploting in a canvas
- Index(es):
Relevant Pages
|