mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 22:24:44 +02:00
Utility: Introduce new helper function Utility::GetFileCreationTime()
This commit is contained in:
parent
8b20a139c5
commit
057254695d
@ -1310,6 +1310,13 @@ bool Utility::PathExists(const String& path)
|
|||||||
return fs::exists(fs::path(path.Begin(), path.End()), ec) && !ec;
|
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)
|
Value Utility::LoadJsonFile(const String& path)
|
||||||
{
|
{
|
||||||
std::ifstream fp;
|
std::ifstream fp;
|
||||||
|
@ -109,6 +109,7 @@ public:
|
|||||||
static tm LocalTime(time_t ts);
|
static tm LocalTime(time_t ts);
|
||||||
|
|
||||||
static bool PathExists(const String& path);
|
static bool PathExists(const String& path);
|
||||||
|
static time_t GetFileCreationTime(const String& path);
|
||||||
|
|
||||||
static void Remove(const String& path);
|
static void Remove(const String& path);
|
||||||
static void RemoveDirRecursive(const String& path);
|
static void RemoveDirRecursive(const String& path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user