Imitating "tail -f"
jasonsewall at gmail.com
Sun Nov 22 05:32:16 CET 2009
FWIW, GNU tail on Linux uses inotify for tail -f:
The wikipedia page for inotify lists several python bindings:
Not much help for non-Linux users, but there it is. Too bad, because inotify
is pretty cool.
On Nov 21, 2009 11:11 PM, <exarkun at twistedmatrix.com> wrote:
On 02:43 am, ivoras at gmail.com wrote: > > I'm trying to simply imitate what
"tail -f" does, i.e. read...
select(), poll(), epoll, etc. all have the problem where they don't support
files (in the thing-on-a-filesystem sense) at all. They just indicate the
descriptor is readable or writeable all the time, regardless.
"tail -f" is implemented by sleeping a little bit and then reading to see if
there's anything new.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list