Hi all,

I noticed that while wget does nicely preserve Last-Modified times from
HTTP downloads, it does not do so for FTP, apparently. The example I see
is the upstream archive of the file tool:

        ftp://ftp.astron.com/pub/file/file-4.26.tar.gz

Wget correctly parses the time information:

$ wget -q -O- ftp://ftp.astron.com/pub/file/ | grep file-4.26
  2008 Aug 30        File        <a 
href="ftp://ftp.astron.com:21/pub/file/file-4.26.tar.gz";>file-4.26.tar.gz</a>  
(584803 bytes)

But on download, the file gets the current time as mtime:

$ wget -q ftp://ftp.astron.com/pub/file/file-4.26.tar.gz && LC_ALL=C ls -l 
file-4.26.tar.gz
-rw-r--r-- 1 thomas thomas 584803 May 29 08:32 file-4.26.tar.gz

I tried several versions of wget 1.x I could find/build. Wget-1.9.1
gets in an endless loop with this URL, wget-1.10.2 works, but also
already sets the wrong time. I wonder why I this comment

        https://bugzilla.mozilla.org/show_bug.cgi?id=178506#c7

in the wonderful bug discussion about Firefox' refusal to use server
mtimes claims that

        GNU's wget does this very nicely for ftp and http downloads.

Maybe wget 22 years ago had different FTP code. I'm not easily able to
run wget that old to try. So it may be a regression before 1.10.2, even
(which is already over 18 years ago!)

FTP support seems to be dropped altogether from Wget 2 (correct?).
There still are some FTP sites (like the rather prominent upstream of
file and libmagic above) and maybe this is another reason why I will
have to resort to curl for good, which does not preserve the time by
default, but offers --remote-time that works for both http and ftp
downloads.

Is a fix in wget 1.x something to be considered at this point in time?


Alrighty then,

Thomas
-- 
GPG public key 60D5CAFE: https://thomas.orgis.org/public_key
Fingerprint: D021 FF8E CF4B E097 19D6  1A27 231C 4CBC 60D5 CAFE
And despite all of you, I'm still doing it. Yes, I do write Perl code.

Attachment: pgpjRVNfOSI8E.pgp
Description: Firma digital OpenPGP

Reply via email to