| 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 |
no test coverage detected