views:

95

answers:

2

Is there a known issue leading to file modification times of cache files on Windows XP SP 3 getting arbitrarily updated, but without any actual change?

Is there some service on a standard Windows XP - Backup, Sync, Versioning, Virus scanner - known to touch files? They all have a .txt extension.

If there isn't, forget it. Then I'm getting something wrong in my cache routines, and I'll debug my way through.

Background:

I'm building a simple caching wrapper around a slow web site on a Windows server.

I am comparing the filemtime() time stamp to some columns in the data base to determine whether a cached file is stale.

I'm having problems using this method because the modification time of the cache files seems to get updated in between operations without me doing anything. THis results in stale files being displayed.

I'm the only user on the machine. The operating system is Windows XP, the webserver a XAMPP Apache 2 with PHP 5.2

+1  A: 

The only mtime issue I can think of is the dreaded DST bug. It doesn't sound quite like what you're getting though.

Certainly there are other Windows tools that might modify a file behind your back, but typically it's user-level stuff like WMP screwing with the ID3 tags, or dodgy AV... not anything I would expect to be touching your cache files.

(Maybe you could try an equality comparison of mtimes rather than greater-than/less-than, only using the cache if there is an exact match? This at least means that if some anti-social bleeder is touching files it'll just slow you down a bit, instead of making you serve stale files. FWIW this is what Python does with its bytecode cache.)

bobince
Cheers Bobince, an equality comparison is a great idea. I'll do some more debugging and if my caching system is 100% innocent (as I said, not sure yet), I'll employ that.
Pekka
+1  A: 

You could setup logging* on the machine to find out what is changing your files. From your description I take this happens frequently, so you might find ProcessMonitor (german) to be a better solution for monitoring.

* I think you can setup logging with on-board tools as well, just not sure anymore how

Gordon