Skip to content
Advertisement

Tag: touch

Simulate touch command with Java

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). Answer The File class has a setLastModified method. That is what ANT does.

Advertisement