File last modified time same as download provider
When I download a file the creation and last modified date & time are set to the download time.
Is there a possibility to restore the creation / modify date & time of the old owner?
Answer
The Windows Explorer has standard behavior when copying or moving files. However, in general, it is up to the application to set the creation / modify time, because Windows provides appropriate APIs for doing so.
Hence, in theory, if you have a proper chain of tools involved, it is possible. Such a toolchain would need to look like that:
-
The original owner, when copying the file from its original place to the place where it is provided for download, must use a file management tool which does not alter the creation / modify time.
-
The same is true for you: When downloading the file, you must use a tool which does not alter the creation / modify time, and of course, does read them at the remote location in the first place.
Regarding the first part, I think it is impossible (in the general case) to force the provider of the file to act as you like.
Regarding the second part, you could use tools like wget
which is available for Windows either as part of Cygwin
or as part of the Gnu-Win32
collection; see here to learn how it could help solve your problem. You could also use curl
which is available for Windows as well; its man page is here – take a look into the --remote-time
option.
wget
and curl
probably only set the modified
time according to your needs, but not the created
time. If this is not sufficient, you have two options:
-
Find a tool which does both (I am not aware of such programs)
-
Write a script or use an another program to set the
created
time from themodified
time, i.e. a program which is able to copy themodified
time attribute over thecreated
time attribute. There are plenty of tools for Windows which can do this, for example this one.