public static void PerformCleanup(IDirectory dir, string path, IFile file)
{
try
{
foreach(var v in dir.GetFiles(path).Where(a => a.Contains("tmp")))
file.Delete(v);
}
// ReSharper disable EmptyGeneralCatchClause
catch
// ReSharper restore EmptyGeneralCatchClause
{
//best effort.
}
}