Re: EOF on a watched handle

[email protected] (Joshua N Pritikin)
Newsgroups perl.loop
Message-ID <[email protected]>
On Tue, Mar 14, 2000 at 10:07:43PM +0100, [email protected] wrote:
> This surely is a basic problem. The question is if there is a
> solution? What I'm looking for is to get a read event (poll=>'r') ONLY
> if there is something to read, not in case of EOF (which could be
> matched by poll=>'e'). Ideally, this solution would result in a lower
> load than the example above.

Actually, I believe the correct solution is to stat the file
periodically.  File::Tail uses both stat and sysseek.  GNU textutils'
tail does something similar.

This question has come up before.  It probably makes sense to include
demo/tail-f in the Event tarball.  Any volunteers?

The other piece that would be nice is integration with IPC::Open2/3.  I
might have to do this myself.  :-)

-- 
"Never ascribe to malice that which can be explained by stupidity."
                           via, but not speaking for Deutsche Bank
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.