bugGNU Wget - Bugs: bug #28541, Faulty time information in FTP...

 
 

bug #28541: Faulty time information in FTP directory listing

Submitter:  Micah Cowan <micahcowan>
Submitted:  Sun 10 Jan 2010 02:46:34 AM UTC
   
 
Category:  Program Logic Severity:  2 - Minor
Priority:  5 - Normal Status:  Needs Investigation
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  None Operating System:  None
Reproducibility:  None Fixed Release:  None
Planned Release:  1.15 Regression:  None
Work Required:  0 - Hours Patch Included:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 04 Nov 2014 11:40:04 PM UTC, comment #2: 

This seems to be fixed (if I understand the first bug report correctly).

This can be verified by checking the output of:

  wget -q -O - ftp://ftp.gnu.org/gnu/ | grep -E "[0-9]{2}:[0-9]{2}"

With a current version of wget (1.16 in this case).

Timestamps with HH::MM are all present.

Fixed by:
commit e6b486fd930fea1a6edddf943c6385be8c74418e
Author: John Trengrove <jtrengrove@gmail.com>
Date:   Sun Aug 1 22:55:53 2010 +0200

    ftp: display hour:minute information if it is available.

For details see
git diff ca12585a0e221e31a59898fe33f1a0caf7918f26 e6b486fd930fea1a6edddf943c6385be8c74418e -- src/ftp-ls.c

But basically, what fixed the problem was:
@@ -907,7 +1139,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
 
           fprintf (fp, "%d %s %02d ", ptm->tm_year + 1900, months[ptm->tm_mon],
                   ptm->tm_mday);
-          if (ptm->tm_hour)
+          if (f->ptype == TT_HOUR_MIN)
             fprintf (fp, "%02d:%02d  ", ptm->tm_hour, ptm->tm_min);
           else
             fprintf (fp, "       ");

This bug report should be closed.

Best regards,
/Pär

Pär Karlsson <feinorgh>
Sun 01 May 2011 06:00:16 PM UTC, comment #1: 

Already fixed in r2414

David Valentim Dias <dvd>
Sun 10 Jan 2010 02:46:34 AM UTC, original submission:  

http://lists.gnu.org/archive/html/bug-wget/2009-12/msg00034.html


      Hello,?
?
  I ran into a (mildly annoying) problem with the timestamps produced for   a FTP directory listing. If the time of a file is between 00:00 and 00:59 the   time field will be left blank in the html-ified output. To see what I   mean, try the following:?
  ?       wget -q -O - ftp://ftp.gnu.org/gnu/ | grep -E "2009   (Dec|Nov|Oct|Sep|Aug|Jul) .. [^0-9]"?
  I'm currently getting three entries that show this (faulty) behavior.?
?
  The reason is quite clear looking at the code of function ftp_index()   in src/ftp-ls.c: The check "if (ptm-&gt;tm_hour)" is responsible for   producing this result, by selecting the else-case for a time between   00:00 and 00:59.?
?
  I can imagine that this was an attempt to cater for the fact that UNIX   style FTP server won't produce time information for "older" files (e.g.    &gt; 180 days old). The output received after a FTP LIST command will show   the year instead of "hh:mm" for these kind of files. Nevertheless it's   wrong (or at least not as good as it should be) for recent files, where   the LIST information contains the time.?
?
  I have found myself a workaround for this problem by either using curl   or the --server-response information and discarding the html-ified output.?
?
  I don't want to mess around with a patch for this bug, but I guess the   "struct fileinfo" could do with an additional flag that gets set accordingly in   the ftp_parse_*_ls() functions (where the parsing takes place). I leave it   up to you guys to make that call. I'm just surprised to have encountered this   issue.?
?
  Cheers?
  Martin?
  ?


Micah Cowan <micahcowan>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by feinorgh (Posted a comment)
  • -email is unavailable- added by dvd (Posted a comment)
  • -email is unavailable- added by micahcowan (Submitted the item)
  •  

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code