Commit in reactos/tools on MAIN
rcopy.c+181.9 -> 1.10
- Set the time of the copied file to the time of the source file.

reactos/tools
rcopy.c 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- rcopy.c	27 Sep 2004 04:32:52 -0000	1.9
+++ rcopy.c	19 Dec 2004 21:49:13 -0000	1.10
@@ -2,6 +2,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <sys/stat.h>
+#include <sys/utime.h>
 #ifdef WIN32
 #include <io.h>
 #include <dos.h>
@@ -85,6 +86,8 @@
    char* buf;
    int n_in;
    int n_out;
+   struct _stat st_buffer;
+   struct _utimbuf ut_buffer; 
 
    in = fopen(path1, "rb");
    if (in == NULL)
@@ -115,6 +118,21 @@
 	     exit(1);
 	  }
      }
+   free(buf);
+   fclose(in);
+   fclose(out);
+
+   if (_stat(path2, &st_buffer) >= 0)
+   {
+      ut_buffer.actime = st_buffer.st_atime;
+   
+      if (_stat(path1, &st_buffer) >= 0)
+      {
+         ut_buffer.modtime = st_buffer.st_mtime;
+	 _utime(path2, &ut_buffer);
+      }
+   }
+   
 }
 
 #ifdef WIN32
CVSspam 0.2.8