[Zope-CMF] Another DirectoryView.py fix :-)
Chris Withers
chrisw@nipltd.com
Mon, 11 Jun 2001 13:53:26 +0100
Martijn Pieters wrote:
>
> On Wed, Jun 06, 2001 at 04:39:52PM +0100, Chris Withers wrote:
> > This one solves the problem I mailed about eariler today:
> > DirectoryView's weren't finding new files or getting rid of them in debug
> > mode on Windows.
> > I think this is because the stat of a directory doesn't change when the
> > contents change, on windows at least.
> >
> > The attached path fixes this. It's not pretty (to make up that that I
> > included a bit of refactoring too ;-) but it does work.
>
> Maybe you should refactor it such that:
>
> - The change check is a separate method.
>
> - On platforms where the mtime *does* change, use a stat, and only on
> Windows use your method. This way we avoid needless looping on smarter
> platforms.
Oops, perhaps I should have said: This patcj only ever comes into play when the
server is running in development mode.
In that context, I did the simplest thing possible that worked since efficiency
in development mode isn't a major thing.
I'm using this all the time now and, to be honest, I haven't noticed any
slowdown.
cheers,
Chris