Possible Duplicate:
Wait until file is unlocked in .NET
I have many cases where a program must wait until a file is unlocked by another process (e.g file being copied) before it can be used again. A standard solution is to wait for it iterating in a loop using Thread.Sleep(). I don't consider that kind nice. I've read it's possible to do it with the FileSystemWatcher of .NET (I'm using C#). Can anyone illustrate it? Thanks a lot for your replies!