[英]Obtain file properties change time using C++ on Windows
我需要使用cpp在Windows中modification time
, creation time
和change time
文件的change time
。 我正在使用以下代碼:
string filename = "D:\\hi.txt";
struct stat result;
if (stat(filename.c_str(), &result) == 0)
{
int a = 10;
auto mod_time = result.st_mtime;
cout << "modified time is: "<<mod_time<<endl;
}
使用這個我可以得到modification
和creation time
。 但是,我無法獲取文件的change time
。 如何使用cpp獲取文件change time
?
以下是“更改時間”的定義。
修改時間會在文件內容更改時更改,並且更改時間也會更改,即使文件的屬性(如訪問權限)也會更改。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.