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
Here's a simple snippet:
void touch(File file, long timestamp) { try { if (!file.exists()) new FileOutputStream(file).close(); file.setLastModified(timestamp); } catch (IOException e) { } }