[Zope-CMF] Another DirectoryView.py fix :-)

Martijn Pieters mj@digicool.com
Wed, 6 Jun 2001 18:18:59 +0200


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.

-- 
Martijn Pieters
| Software Engineer  mailto:mj@digicool.com
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
---------------------------------------------