File explorer copies files without changing their "last modified" property, File.Copy does change it.
Is there a way to copy a file without modifying its "last modified" property ?
I've found this link showing how you can set this property in java http://examples.javacodegeeks.com/core-java/io/file/change-file-last-modified-date-in-java-example/
As a workaround I could copy the file and then set the time to the original time. Can someone show me how to use it with javaobject ?
Dim f As JavaObject
f.InitializeNewInstance("java.io.File", Array(File.Combine(dir, filename))
f.RunMethod("setLastModified", Array(File.LastModified(original file)))
For some reason it does not work on directories, any solution for that ?
Actully the LastModified parameter is changed but the display still shows the creation time.
I don't see a method to set the creation time.
Edit: I think I know what the reason is - the time of the directory is updated with every new file that is written. I'll have to change the time after all files are there... to check tomorrow.
Edit: Yes, this is it, problem solved.