I want to get answer if I can replace old files or not - if files are older I don't want to copy. The problem is - the count of files in every directory can be different.
I don't want to write many methods, just one simply LINQ query, but I am rather weak in LINQ.
I would like to return true or false using LINQ.
System.IO.FileInfo[] filesSource = new System.IO.DirectoryInfo(sources).GetFiles();
System.IO.FileInfo[] filesTarget = new System.IO.DirectoryInfo(target).GetFiles();
bool canCopy = ...
/* group - if file have the same name
if can't match and group - simply ignore it */ ...
(x => x.Source.LastWriteTime < x.Target.LastWriteTime).Count() == 0;