windows 文件时间戳不会随着数据更新而改变

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3226513/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:48:33  来源:igfitidea点击:

File time stamp does not change with data update

windowsfile-io

提问by Avinash

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.

我有疑问为什么任何应用程序都会有这种行为。

回答by Alexander Samoylov

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: //superuser.com/questions/292630/how-can-i-change-the-timestamp-on-a-file。奇怪的是“复制/?” 没有说 /b 选项。