diff --git a/Utilities/File.cpp b/Utilities/File.cpp index ef701dd4ad..32c002a544 100644 --- a/Utilities/File.cpp +++ b/Utilities/File.cpp @@ -301,6 +301,9 @@ bool fs::stat(const std::string& path, stat_t& info) info.ctime = info.mtime; #endif + if (info.atime < info.mtime) + info.atime = info.mtime; + return true; } @@ -888,6 +891,9 @@ fs::file::file(const std::string& path, bs_t mode) info.mtime = to_time(basic_info.ChangeTime); info.ctime = info.mtime; + if (info.atime < info.mtime) + info.atime = info.mtime; + return info; } @@ -1035,6 +1041,9 @@ fs::file::file(const std::string& path, bs_t mode) info.mtime = file_info.st_mtime; info.ctime = info.mtime; + if (info.atime < info.mtime) + info.atime = info.mtime; + return info; } @@ -1242,6 +1251,9 @@ bool fs::dir::open(const std::string& path) info.mtime = to_time(found.ftLastWriteTime); info.ctime = info.mtime; + if (info.atime < info.mtime) + info.atime = info.mtime; + m_entries.emplace_back(std::move(info)); } @@ -1325,6 +1337,9 @@ bool fs::dir::open(const std::string& path) info.mtime = file_info.st_mtime; info.ctime = info.mtime; + if (info.atime < info.mtime) + info.atime = info.mtime; + return true; }