mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
resolve symlinks when searching for file's last modified time.
This commit is contained in:
parent
514fba5f73
commit
f6128a85b2
1 changed files with 5 additions and 4 deletions
|
@ -883,15 +883,16 @@ void MwIniImporter::setInputEncoding(const ToUTF8::FromType &encoding)
|
||||||
std::time_t MwIniImporter::lastWriteTime(const boost::filesystem::path& filename, std::time_t defaultTime)
|
std::time_t MwIniImporter::lastWriteTime(const boost::filesystem::path& filename, std::time_t defaultTime)
|
||||||
{
|
{
|
||||||
std::time_t writeTime(defaultTime);
|
std::time_t writeTime(defaultTime);
|
||||||
if (boost::filesystem::exists(filename))
|
boost::filesystem::path resolved = boost::filesystem::canonical(filename);
|
||||||
|
if (boost::filesystem::exists(resolved))
|
||||||
{
|
{
|
||||||
writeTime = boost::filesystem::last_write_time(filename);
|
writeTime = boost::filesystem::last_write_time(resolved);
|
||||||
std::cout << "content file: " << filename << " timestamp = (" << writeTime <<
|
std::cout << "content file: " << resolved << " timestamp = (" << writeTime <<
|
||||||
") " << asctime(localtime(&writeTime)) << std::endl;
|
") " << asctime(localtime(&writeTime)) << std::endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "content file: " << filename << " not found" << std::endl;
|
std::cout << "content file: " << resolved << " not found" << std::endl;
|
||||||
}
|
}
|
||||||
return writeTime;
|
return writeTime;
|
||||||
}
|
}
|
Loading…
Reference in a new issue