From 3e4813214b9a7c7f991cae747aa73865510119e5 Mon Sep 17 00:00:00 2001 From: Marcelo Duarte Date: Tue, 1 Mar 2005 10:42:22 +0000 Subject: [PATCH] CopyFile needs to retain timestamp. --- dlls/kernel/path.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/kernel/path.c b/dlls/kernel/path.c index c274237b2b1..8461ce9b3af 100644 --- a/dlls/kernel/path.c +++ b/dlls/kernel/path.c @@ -852,6 +852,7 @@ BOOL WINAPI CopyFileW( LPCWSTR source, LPCWSTR dest, BOOL fail_if_exists ) { HANDLE h1, h2; BY_HANDLE_FILE_INFORMATION info; + FILETIME filetime; DWORD count; BOOL ret = FALSE; char buffer[2048]; @@ -900,6 +901,10 @@ BOOL WINAPI CopyFileW( LPCWSTR source, LPCWSTR dest, BOOL fail_if_exists ) } ret = TRUE; done: + /* Maintain the timestamp of source file to destination file */ + GetFileTime(h1, NULL, NULL, &filetime); + SetFileTime(h2, NULL, NULL, &filetime); + CloseHandle( h1 ); CloseHandle( h2 ); return ret;