问题
I have customer which claims that he has one application which updates the data in log file but that application does not change the time stamp of the log file.
I have question why would any application has such behavior.
回答1:
It's a new FEATURE of Windows 2008 (R2), Windows 7 and up. Modified time is not updated anymore like it used to in Windows 2003.
http://blogs.technet.com/b/asiasupp/archive/2010/12/14/file-date-modified-property-are-not-updating-while-modifying-a-file-without-closing-it.aspx
And
http://social.technet.microsoft.com/Forums/en-US/winservergen/Thread/2B8BACA2-9C1B-4D80-80ED-87A3D6B1336F
回答2:
There is a good workaround for build automation:
copy /b <Filename> +,,
I found this trick here: https://superuser.com/questions/292630/how-can-i-change-the-timestamp-on-a-file. The strange is that "copy /?" does not say about /b option.
来源:https://stackoverflow.com/questions/3226513/file-time-stamp-does-not-change-with-data-update