Is there a good way to check if a file locked other than attempting to open in as a text reader and looking for an exception?
I guess I could do this:
try
{
stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None);
}
catch (IOException)
{
....
}
Is there a better way?