文件的最后写入时间

文件的最后写入时间

问题描述:

我很好奇,但无法通过谷歌搜索找到答案.文件LastWriteTime的实际时间是多少?是在第一次写入文件时还是在文件写入完成时?谢谢.

I am curious and I haven''t been able to find the answer by googling. What is the actual time of a files LastWriteTime? Is it when the file is first being written or is it when the file finishes being written? Thank you.

如果有内存可用,则在关闭文件时会更新时间.只需用几行代码即可确认.
If memory serves the time is updated when the file is closed. This should be fairly easy to confirm with a few lines of code.


根据GetFileTime()的文档 ^ ] Windows会同时记录创建时间和文件最后写入的时间.选择一个对您有用的.
According to the documentation for GetFileTime() [^] Windows records *both* the creation time *and* the time the file was last written to. Pick the one that''s useful to you.


阅读: ^ ]