--- On Tue, 8/23/11, David H. Lipman <[email protected]> wrote:

> From: David H. Lipman <[email protected]>
> Subject: Re: [Bug-wget] Download files and preserve their data and time
> To: [email protected]
> Date: Tuesday, August 23, 2011, 4:38 PM
> From: "Giuseppe Scrivano" <[email protected]>
> 
> >
> >> WinXP/Vista -- Win32
> >>
> >> Y:\>wget --version
> >> GNU Wget 1.12-2504 built on mingw32.
> >
> > the change introduced by the revision
> > [email protected]
> could be the reason of
> > the problem you have reported.

Calling utime() works. You could also use SetFileTime(). 2489 changed utime to 
utimes but the CRT doesn't have utimes. 

I recompiled 1.13.1 and patched for the http.c fixes from 2544 and 2541, and 
patched utils using the touch() prior to 2489 for WINDOWS. This is a test build 
and I uploaded it here:
http://sourceforge.net/projects/getgnuwin32/files/getgnuwin32/test%20builds/wget-1.13.1.patched.zip/download

I tried Giuseppe's example:

>wget -q -d http://www.gnu.org/graphics/gnu-head-mini.png 2>&1 | grep ^Last-Mo
Last-Modified: Sun, 05 Dec 2010 20:58:51 GMT

>dir /tw gnu-head-mini.png
[...]
12/05/2010  03:58 PM               423 gnu-head-mini.png


Also I notice the changes in 2533 require static openssl libs for testing
checking for EVP_MD_CTX_init in -leay32... yes
checking for SSL_connect in -lssl32... yes
configure: Enabling support for SSL via OpenSSL (shared)
checking for libssl... no
configure: error: --with-ssl=openssl was given, but SSL is not available.

I think regardless of whether libssl is there if eay32 and ssl32 are there then 
it should link to the dlls and not need to test ssl and crypto.

Thanks
--- utils - Copy.c	2011-08-11 08:17:39.000000000 -0400
+++ utils.c	2011-08-24 00:42:03.840000000 -0400
@@ -483,7 +483,18 @@
 /* "Touch" FILE, i.e. make its mtime ("modified time") equal the time
    specified with TM.  The atime ("access time") is set to the current
    time.  */
-
+#ifdef WINDOWS
+void
+touch (const char *file, time_t tm)
+{
+  struct utimbuf times;
+  
+  times.modtime = tm;
+  times.actime = time (NULL);
+  if (utime (file, &times) == -1)
+    logprintf (LOG_NOTQUIET, "utime(%s): %s\n", file, strerror (errno));
+}
+#else
 void
 touch (const char *file, time_t tm)
 {
@@ -507,6 +518,8 @@
 
   close (fd);
 }
+#endif
+
 
 /* Checks if FILE is a symbolic link, and removes it if it is.  Does
    nothing under MS-Windows.  */

Reply via email to