Skip to content

Commit 26b3fec

Browse files
committed
Utility: Introduce new funk helper Utility::GetFileCreationTime()
1 parent 93c59e8 commit 26b3fec

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/base/utility.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,14 @@ bool Utility::PathExists(const String& path)
13101310
return fs::exists(fs::path(path.Begin(), path.End()), ec) && !ec;
13111311
}
13121312

1313+
time_t Utility::GetFileCreationTime(const String& path)
1314+
{
1315+
namespace fs = boost::filesystem;
1316+
fs::path filePath(path);
1317+
1318+
return fs::last_write_time(filePath);
1319+
}
1320+
13131321
Value Utility::LoadJsonFile(const String& path)
13141322
{
13151323
std::ifstream fp;

lib/base/utility.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class Utility
109109
static tm LocalTime(time_t ts);
110110

111111
static bool PathExists(const String& path);
112+
static time_t GetFileCreationTime(const String& path);
112113

113114
static void Remove(const String& path);
114115
static void RemoveDirRecursive(const String& path);

0 commit comments

Comments
 (0)