FilePath stat cache cleaning should happen lazily, to avoid unnecessary stat() calls

[email protected] Tue, 24 Nov 2009 00:47:10 -0000
Newsgroups gmane.comp.python.twisted.bugs
Message-ID <[email protected]>
New submission from glyph <[email protected]>:

When calling, for example, `FilePath.remove()`, we have to re-stat the file to get correct behavior, otherwise the file still appears to exist.

However, maybe we don't care about what the file looks like any more.  Maybe we're never going to call `stat()` again, before the `FilePath` gets garbage collected.  If that is the case, then calling it again would be a waste.

There should be a method, perhaps `FilePath.changed()` [http://trac.calendarserver.org/browser/CalendarServer/trunk/lib-patches/Twisted/twisted.python.filepath.patch as implemented here], for example, which just tells a `FilePath` to forget about its cache ''without'' immediately getting a new cache.

----------
Type     : enhancement
Component: core
Keywords : 
Priority : normal
Nosy     : 
----------
http://twistedmatrix.com/trac/ticket/4130