[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] wget a file from remote, but local file doesn't contains
Re: [Bug-wget] wget a file from remote, but local file doesn't contains timestamp
Wed, 16 Feb 2011 10:42:42 -0800
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:220.127.116.11) Gecko/20101208 Thunderbird/3.1.7
(02/15/2011 08:38 AM), Kevin Dong (INT) wrote:
> I use wget in WindowsXP to download a image file, say tp.tiff, from remote
> machine. The command I used is:
> wget -r -N -nd http://192.168.5.100/images/tp.tiff
> My local WindowsXP machine can put correct timestamp on any other files, but
> when I retrieve this tp.tiff using above wget command, the "Date Modified"
> column of this tp.tiff is empty in Windows Explorer.
> I guess maybe I didn't use proper optional switches. My question is how to
> put local time stamp on to this tp.tiff downloaded by wget?
It shouldn't be a matter of switches; according to current (and
long-standing) behavior, wget _always_ adds timestamps to files (whether
you want them or not - there are valid use cases for not wanting them).
Unix has no notion of "missing timestamps", so date-modified columns are
never ever empty (though they certainly may contain bogus information).
Looking at the source code, I can't really see how this situation can
occur... presumably, if wget doesn't explicitly set a date-modified for
a file, it should automatically get a timestamp for "right now", yes? So
it appears to me that the only way you can get into this situation is by
wget explicitly setting the timestamp to a nil value; but wget makes
sure never to set timestamps unless it has a valid value, so I'm really
not sure how this can happen.
What version of wget is this, by the way?
It might be useful to know whether the server issues timestamping
information for that file. If you run wget with --debug, do you see the
server send a "Last-Modified" header? And does wget say anything like
"time-stamps turned off" or "time-stamp ignored"?
Micah J. Cowan