File indexing completed on 2024-04-06 11:57:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include "TROOT.h"
0011 #include "TString.h"
0012 #include "TObjString.h"
0013
0014 int compareFileAges(const char* newestCandidate, const char* filesToCompare) {
0015
0016 Long_t dummy = 0;
0017 Long_t candidateTime = 0;
0018 Long_t comparisonTime = 0;
0019 int found = !gSystem->GetPathInfo(newestCandidate, &dummy, &dummy, &dummy,
0020 &candidateTime);
0021
0022
0023 if(!found)
0024 return 1;
0025
0026
0027 TObjArray* compareList = TString(filesToCompare).Tokenize(" ");
0028
0029
0030 for (Int_t iFile = 0; iFile < compareList->GetEntriesFast(); ++iFile) {
0031 found = !gSystem->GetPathInfo(compareList->At(iFile)->GetName(), &dummy,
0032 &dummy, &dummy, &comparisonTime);
0033
0034
0035 if(found && candidateTime <= comparisonTime)
0036 return 1;
0037 }
0038
0039
0040 return 0;
0041 }