I am writing a piece of .NET code which needs to overwrite image files in a website hosted on IIS 6 or 7. The only processes that should be touching the images are IIS and m
This is possible, given that while any file is being read, it is locked during the read, so you could run into a situation where IIS is reading and serving the file, and you're trying to write to the file at the same time.
This and this may provide some help with waiting for the file, then locking it. Bear in mind that you could cause IIS to respond slower as it waits for the file as well.