monitoring a directory
noah at noah.org
Thu Mar 25 19:09:28 CET 2004
Guy Robinson <guy at NOSPAM.r-e-d.co.nz> wrote in message news:<c3udtb$raj$1 at lust.ihug.co.nz>...
> Cheers Tim, that's the ticket. Perfect!!!
> >>What would be the most efficient or 'clever' way to monitor a
> >>for file additions/ modifications on windows?
> >>Currently I'm looping through the directory with a 1 sec delay. But
> >>doesn't seem that clever.
> > There are two methods that I know of (apart from the simple approach you
> > describe). One is described in this recipe:
> > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/156178
Now how do I do this for UNIX?
I always did the 1 second looping thing and felt somewhat ashamed that
I couldn't think of anything better... It seems like there should be
some sort of blocking system call that will return when a directory or
file changes -- something like "select".
More information about the Python-list