Re: fileevent



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


.



Relevant Pages

  • accessing a pipe from TCL and C, hang in `close/exit
    ... I have a TCL shell script which opens a socket to some remote host, ... and opens a read-converter pipe. ... data arrives on the remote host. ... Now I want to close the channel from C++: ...
    (comp.lang.tcl)
  • I can process my mail!
    ... I figured out how to pipe mail to my own scripts! ... the script as an argument. ... that won't confuse boundaries for message text. ... sendmail, but I'm not that interested in sendmail in particular. ...
    (comp.unix.questions)
  • Re: how do i..
    ... On Sun, 2004-08-22 at 18:31, Mr. Oberoi wrote: ... > error results from the program(shell script) to a file. ... scriptname> filename 2>&1 ... the pipe character is used to "chain" the output of the command on ...
    (Fedora)
  • Re: IO::Pipe and loss of data
    ... May be I cut too much, but as the last run of my big script was ... > show at least how I work to send a message and use the pipe. ... There is a fixed amount of buffer (probably 4K ... for each "server". ...
    (comp.lang.perl.misc)
  • Re: Standard output piping problem
    ... My composer cut off a pipe character in the middle of the sed script. ... > that printf might solve the problem. ...
    (comp.unix.shell)