mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#9614 Check last write time for ESMRY files and SMSPEC files
This commit is contained in:
@@ -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