From b37e6688c043dcd8676fceac3019f468f1e83e55 Mon Sep 17 00:00:00 2001 From: 0TheSpy <5511c282@opayq.com> Date: Sat, 10 Jul 2021 19:17:21 +0300 Subject: [PATCH] Update Config.hpp --- SpyCustom/Config.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/SpyCustom/Config.hpp b/SpyCustom/Config.hpp index 6b4119b..5a2aab0 100644 --- a/SpyCustom/Config.hpp +++ b/SpyCustom/Config.hpp @@ -160,20 +160,25 @@ public: std::string search_path = "*.ss"; WIN32_FIND_DATA fd; HANDLE hFind = ::FindFirstFile(search_path.c_str(), &fd); + std::string vremya; if (hFind != INVALID_HANDLE_VALUE) { do { if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { - configs.push_back(fd.cFileName); + configs.push_back(fd.cFileName); time_t epoch = to_time_t(fd.ftLastWriteTime); - std::string vremya = asctime(gmtime(&epoch)); - times.push_back(vremya); + time_t creation = to_time_t(fd.ftCreationTime); + if (epoch != creation) + vremya = asctime(localtime(&epoch)); + else + vremya = "empty"; + times.push_back(vremya); #ifdef DEBUG printf("fn %s %s", fd.cFileName, vremya.c_str()); #endif } } while (::FindNextFile(hFind, &fd)); ::FindClose(hFind); - } + } }