Imitating "tail -f"

Paul Rudin paul.nospam at rudin.co.uk
Sun Nov 22 07:20:45 EST 2009


Matt Nordhoff <mnordhoff at mattnordhoff.com> writes:

> Jason Sewall wrote:
>> 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
>
> Some other operating systems have similar facilities, e.g. FSEvents on OS X.

Yeah, and there's a similar kind of thing in the windows api.

A nice python project would be a cross-platform solution that presented
a uniform api and just did the right thing behind the scenes on each OS.

(Incidentally on linux you need to watch out for the value of
/proc/sys/fs/inotify/max_user_watches - if you're using inotify in anger
it's easy to exceed the default set by a lot of distributions.)



More information about the Python-list mailing list