private static Stream OpenFile( FileInfo fi, int timeOut )
{
Stream stream = null;
try
{
stream = File.Open(fi.FullName, FileMode.Open, FileAccess.Read, FileShare.Read);
}
catch (Exception e )
{
if (timeOut-- <= 0)
throw e;
Thread.Sleep( 100 );
stream = OpenFile( fi, timeOut );
}
return stream;
}