Update Config.hpp

This commit is contained in:
0TheSpy
2021-07-10 19:17:21 +03:00
committed by GitHub
parent b73ff98f9d
commit b37e6688c0

View File

@ -160,12 +160,17 @@ public:
std::string search_path = "*.ss"; std::string search_path = "*.ss";
WIN32_FIND_DATA fd; WIN32_FIND_DATA fd;
HANDLE hFind = ::FindFirstFile(search_path.c_str(), &fd); HANDLE hFind = ::FindFirstFile(search_path.c_str(), &fd);
std::string vremya;
if (hFind != INVALID_HANDLE_VALUE) { if (hFind != INVALID_HANDLE_VALUE) {
do { do {
if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
configs.push_back(fd.cFileName); configs.push_back(fd.cFileName);
time_t epoch = to_time_t(fd.ftLastWriteTime); time_t epoch = to_time_t(fd.ftLastWriteTime);
std::string vremya = asctime(gmtime(&epoch)); time_t creation = to_time_t(fd.ftCreationTime);
if (epoch != creation)
vremya = asctime(localtime(&epoch));
else
vremya = "empty";
times.push_back(vremya); times.push_back(vremya);
#ifdef DEBUG #ifdef DEBUG
printf("fn %s %s", fd.cFileName, vremya.c_str()); printf("fn %s %s", fd.cFileName, vremya.c_str());