mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
#9614 Check last write time for ESMRY files and SMSPEC files
This commit is contained in:
1 parent
4c0e7b2979
commit
28b3f16db1
6 files changed
+101
-36
No files matched your search
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <QDir>
|
||||
|
||||
#include <filesystem>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
@@ -362,3 +363,16 @@ std::map<QString, QStringList> RiaFilePathTools::keyPathComponentsForEachFilePat
|
||||
|
||||
return keyComponents;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaFilePathTools::isFirstOlderThanSecond( const std::string& firstFileName, const std::string& secondFileName )
|
||||
{
|
||||
if ( !std::filesystem::exists( firstFileName ) || !std::filesystem::exists( secondFileName ) ) return false;
|
||||
|
||||
auto timeFirstFile = std::filesystem::last_write_time( firstFileName );
|
||||
auto timeSecondFile = std::filesystem::last_write_time( secondFileName );
|
||||
|
||||
return ( timeFirstFile < timeSecondFile );
|
||||
}
|
||||
@@ -48,4 +48,6 @@ public:
|
||||
static QStringList splitPathIntoComponents( const QString& path, bool splitExtensionIntoSeparateEntry = false );
|
||||
|
||||
static std::map<QString, QStringList> keyPathComponentsForEachFilePath( const QStringList& filePaths );
|
||||
|
||||
static bool isFirstOlderThanSecond( const std::string& firstFileName, const std::string& secondFileName );
|
||||
};
|
||||
Reference in new issue
Block a user