To answer your question, it would be more efficient to write the following extension method for the FileInfo class:
public static bool IsLocked(this FileInfo f)
{
try
{
string fpath = f.FullName;
FileStream fs = File.OpenWrite(fpath);
fs.Close();
return false;
}
catch (Exception) { return true; }
}
Once you have created the method, you can do a quick check like this:
FileInfo fi = new FileInfo(@"C:\4067918.TIF");
if (!fi.IsLocked()) { //DO SOMETHING HERE; }