It seems touch() is called on an open file and hence
utime() is either silently ignored or causing "Access denied" on
Watcom.
I added this inside touch():
DEBUGP (("touching %s to %.24s\n", file, asctime(localtime(&tm))));
And ran:
>wget -d -Otcpdump.tgz http://www.tcpdump.org/daily/tcpdump-2003.09.29.tar.gz
---request begin---
GET /daily/tcpdump-2003.09.29.tar.gz HTTP/1.0
User-Agent: Wget/1.9-b5
...
Last-Modified: Mon, 29 Sep 2003 09:05:27 GMT
ETag: "492f4-7e693-3f77f5d7"
...
touching tcpdump.tgz to Mon Sep 29 11:05:27 2003
..
>dir /mk tcp*
13.10.2003 19:01 517 779 tcpdump.tgz
As you see utime() doesn't do anything.
The code in http.c/ftp.c is hard to follow, so question is
when the touch() is called. Should IMHO be called after the
file is closed.
Alternative hack (only for MingW/MSVC) is to use
int _futime (int handle, struct _utimbuf *filetime);
but I guess no one else has this.
--gv