Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#731 <uptodate> task may return wrong result

unknown
open
nobody
Tasks (408)
5
2010-04-27
2010-04-27
Citizen Insane
No

The 'UpToDate' task will return wrong result in case there is more than 1 file in "targetfiles" and if some of them exists, but others don't.

This is because the test on primary file is wrong:

FileInfo primaryFile = _targetFiles.MostRecentLastWriteTimeFile;
if (primaryFile == null || !primaryFile.Exists) {
value = false;
Log(Level.Verbose, "Destination file(s) do(es) not exist.");
} else {
[blablabla...]
Log(Level.Verbose, "{0} is newer than {1}.", newerFile, primaryFile.Name);
}

primaryFile ==> Not null (because some target files exist already)
primaryFile.Exists ==> true (because some target files exist already)
And patatra ...

Discussion