monitoring a directory
Noah
noah at noah.org
Thu Mar 25 13:09:28 EST 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!!!
> Regards,
> Guy
> >>What would be the most efficient or 'clever' way to monitor a
> >>directory
> >>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".
Yours,
Noah
More information about the Python-list
mailing list