MCPcopy Create free account
hub / github.com/davisking/dlib / select_oldest_file

Function select_oldest_file

dlib/dir_nav/dir_nav_extensions.cpp:99–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97// ----------------------------------------------------------------------------------------
98
99 std::string select_oldest_file (
100 const std::string& filename1,
101 const std::string& filename2
102 )
103 {
104 file f1, f2;
105 try{f1 = file(filename1);} catch(file::file_not_found&) { return filename1; }
106 try{f2 = file(filename2);} catch(file::file_not_found&) { return filename2; }
107
108 if (f1.last_modified() < f2.last_modified())
109 return filename1;
110 else
111 return filename2;
112 }
113
114// ----------------------------------------------------------------------------------------
115

Callers 1

oldest_syncfileMethod · 0.85

Calls 2

fileClass · 0.70
last_modifiedMethod · 0.45

Tested by

no test coverage detected