2006/2/2, Graham Dumpleton <[EMAIL PROTECTED]>: > Okay, false alarm (I think). Have got myself worked up over nothing. > I missed something very important: > > timestamp = fstat(opened.fileno())[-2] > > That is the '[-2]' in the above. > > I feel like a goose now. > > I still though question why file/fstat is done and not stat/file though. > Ie., why open the file to stat it? > > Graham
Well, I thought that if the file was modified, we needed to open it anyway, but you're right, that's optimising for a minority case. We might as well use stat and open the file only if it has changed. I've wrote an alternative publisher a few months ago that overloaded this behaviour in the module cache to use req.finfo[apache.FINFO_MTIME] as the file modification time, thus saving us a call to fstat or stat entirely. I've stopped using this publisher because I thought that using the standard publisher was a better way to see how we could improve it, but anyway, I could back port this trick. If I don't get burned down by the flak I'm currently getting on the Python 2.2 issue, that is ;). Regards, Nicolas