Utility: Introduce new helper function Utility::GetFileCreationTime()

This commit is contained in:
Yonas Habteab 2021-01-14 18:39:14 +01:00
parent 8b20a139c5
commit 057254695d
2 changed files with 8 additions and 0 deletions

View File

@ -1310,6 +1310,13 @@ bool Utility::PathExists(const String& path)
return fs::exists(fs::path(path.Begin(), path.End()), ec) && !ec;
}
time_t Utility::GetFileCreationTime(const String& path)
{
namespace fs = boost::filesystem;
return fs::last_write_time(boost::lexical_cast<fs::path>(path));
}
Value Utility::LoadJsonFile(const String& path)
{
std::ifstream fp;

View File

@ -109,6 +109,7 @@ public:
static tm LocalTime(time_t ts);
static bool PathExists(const String& path);
static time_t GetFileCreationTime(const String& path);
static void Remove(const String& path);
static void RemoveDirRecursive(const String& path);