用Java模拟touch命令(Simulate touch command with Java)

编程入门 行业动态 更新时间:2024-10-27 07:19:53
用Java模拟touch命令(Simulate touch command with Java)

我想修改二进制文件的修改时间戳。 这样做最好的方法是什么?

打开和关闭文件是一个很好的选择吗? (我需要一个解决方案,时间戳的修改将在每个平台和JVM上进行更改)。

I want to change modification timestamp of a binary file. What is the best way for doing this?

Would opening and closing the file be a good option? (I require a solution where the modification of the timestamp will be changed on every platform and JVM).

最满意答案

File类有一个setLastModified方法。 这就是ANT所做的。

The File class has a setLastModified method. That is what ANT does.

更多推荐

本文发布于:2023-08-05 21:59:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1440227.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令   touch   Java   Simulate   command

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!