static bool SameFileContent(string path1, string path2)
{
if (!RobustFile.Exists(path1))
return false;
if (!RobustFile.Exists(path2))
return false;
try
{
var first = RobustFile.ReadAllBytes(path1);
var second = RobustFile.ReadAllBytes(path2);
if (first.Length != second.Length)
return false;
for (int i = 0; i < first.Length; i++)
if (first[i] != second[i])
return false;
return true;
}
catch (IOException)
{
return false; // can't even read
}
}