mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 06:23:26 +02:00
Platform modtime, little changes to entergame
This commit is contained in:
@@ -43,6 +43,7 @@ public:
|
||||
std::string getCPUName();
|
||||
double getTotalSystemMemory();
|
||||
std::string getOSName();
|
||||
time_t getFileModificationTime(const std::string& filename);
|
||||
};
|
||||
|
||||
extern Platform g_platform;
|
||||
|
@@ -160,5 +160,15 @@ std::string Platform::getOSName()
|
||||
return std::string();
|
||||
}
|
||||
|
||||
time_t Platform::getFileModificationTime(const std::string& filename)
|
||||
{
|
||||
struct stat attrib;
|
||||
if(stat(filename.c_str(), &attrib))
|
||||
perror(filename.c_str());
|
||||
else
|
||||
return attrib.st_mtime;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -401,4 +401,13 @@ std::string Platform::getOSName()
|
||||
return ret;
|
||||
}
|
||||
|
||||
time_t Platform::getFileModificationTime(const std::string& filename)
|
||||
{
|
||||
//TODO
|
||||
/*WIN32_FILE_ATTRIBUTE_DATA fileAttrData = {0};
|
||||
GetFileAttributesEx(filename.c_str(), GetFileExInfoStandard, &fileAttrData);
|
||||
return fileAttrData.ftLastWriteTime;*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user