I understand my problem better now. When another process has a lock on the
file, I would like to wait until the lock is released and then do my append.
How can I do this?
Thanks,
Colin.
Hi Colin,
By default, if you open a file for writting, it is locked and not
others cannot write to the same file until you close it. It you also
don't want others to read, you could pass FileShare.None to the
constructor of FileStream.
FileStream stream = new FileStream(name, FileMode.Append,
FileAccess.Write, FileShare.None);
StreamWriter w = new StreamWriter(stream);
Regards,
Thi -
http://thith.blogspot.com