FWIW, GNU tail on Linux uses inotify for tail -f:

http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tail.c

The wikipedia page for inotify lists several python bindings:

http://en.wikipedia.org/wiki/Inotify

Not much help for non-Linux users, but there it is. Too bad, because inotify
is pretty cool.

Jason

On Nov 21, 2009 11:11 PM, <exar...@twistedmatrix.com> wrote:

On 02:43 am, ivo...@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.

Jean-Paul

-- http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to