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

Function select_newest_file

dlib/dir_nav/dir_nav_extensions.cpp:116–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114// ----------------------------------------------------------------------------------------
115
116 std::string select_newest_file (
117 const std::string& filename1,
118 const std::string& filename2
119 )
120 {
121 file f1, f2;
122 try{f1 = file(filename1);} catch(file::file_not_found&) { return filename2; }
123 try{f2 = file(filename2);} catch(file::file_not_found&) { return filename1; }
124
125 if (f1.last_modified() > f2.last_modified())
126 return filename1;
127 else
128 return filename2;
129 }
130
131// ----------------------------------------------------------------------------------------
132

Callers 1

newest_syncfileMethod · 0.85

Calls 2

fileClass · 0.70
last_modifiedMethod · 0.45

Tested by

no test coverage detected