Quote:

However, one thing that occurs -- this is a web app, yes? In which case, it'll probably be running in a single ASP.NET helper process, which means that process-afinity locks are no use to you.

On the other hand, since this is a single process, you don't need the mutex, either. You can simply stash an object ("FileArbiter" maybe?) in the HTTP Application state, which you can then get at from the Page methods.

The HttpApplicationState object is available from Page.Application, or HttpContext.Current.Application.



Unfortunately not, it isn't running within ASP.NET

It is running from "classic" ASP, via a COM interop wrapper. It has to be that way as it is called from a massive exsisting VBScript/Javascript ASP app.

I'll take a look at what I can do with FileStream.Lock tomorrow, otherwise it looks like Mutex might be the best option. Better look to see if there are limits on the number of named Mutexes that you can have as well...
_________________________
Remind me to change my signature to something more interesting someday