File locking

My script hangs

Check:
  1. That you're not invoking it with a GET when it's expecting a POST;
  2. That you've remembered the %s parameters in the App Mappings (or registry Script Map, if you're on IIS3), so that perl is being told which file to execute, and isn't trying to read its scripts from stdin.

Another possibility is that your script is trying to write to a file that IIS4 has locked, so that you're sitting there waiting for the lock to be released; guestbooks, for example.

I can't delete files

It appears that IIS4 locks files when it opens them, and doesn't release the locks for a short while. This means that you can't delete them, or overwrite them with more up-to-date versions, until it decides to release the lock.

A particularly insidious aspect of this is that the server tracks what page the browser is looking at. If you're looking at a page with a browser, the page is locked and you can't delete it. If you move to another page, the first is unlocked.

If you can afford to, you can reduce this problem by turning off caching in your server. This apparently also stops caching for DLLs, ASP pages, etc. too.

If desperate to change a page, stopping and restarting the web server will clear out the lock, but that's a little extreme.


Steve Kilbane. Whitecrow home.