ralph
11/25/2011 6:18:00 AM
On Thu, 24 Nov 2011 23:55:57 -0600, ralph <nt_consulting64@yahoo.net>
wrote:
>On Thu, 24 Nov 2011 21:04:49 -0800, BeeJ <nospam@spamnot.com> wrote:
>
>>Using API CreateFile (Open), WriteBytes, CloseHandle etc to copy files.
>>But the copied file has the "Now" date and time and I want the original
>>source file date and time. I know how to change this but trying to
>>find so adjunct API to simply tell the copy process to maintain the
>>source date and time or some API to fixup before calling the
>>CloseHandle.
>>Is there some parameter or API call to signal this?
>>
>
>Don't copy. Move.
>
>-ralph
Use Robocopy if you have it, or XCopy if you don't.
Otherwise it is going to be exactly as you already figured out:
Capture the original File info, copy the file, then touch the new file
with the original info, ie, how RoboCopy and XCopy do it.
-ralph