mirror of https://github.com/Icinga/icinga2.git
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;
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue