Make `ftp-make-file-seconds' use a correct year instead of 2002.

This function was using 2002 when there's no year...  Updated it to use
the last occurrence of the guessed date, as described at
  http://files.stairways.com/other/ftp-list-specs-info.txt

This function still looks pretty bogus -- the RFC does *not* say
anything about the format of response to `LIST', so it's whatever
semi-random thing the server does.  (The above link looks like an
attempt to fix it, but I didn't see anything more official than that.)
From some looking around, it looks like ftp clients just try a bunch of
patterns against the text.  Add also warnings in the documentation about
this.

original commit: 234015b34d
This commit is contained in:
Eli Barzilay 2011-08-04 23:24:50 -04:00
parent 844402b102
commit 55405d017b

View File

@ -52,14 +52,20 @@ depending on whether the items is a file, directory, or link,
respectively. The second item is the file's date; to convert this respectively. The second item is the file's date; to convert this
value to seconds consistent with @racket[file-seconds], pass the date value to seconds consistent with @racket[file-seconds], pass the date
string to @racket[ftp-make-file-seconds], below. The third string is string to @racket[ftp-make-file-seconds], below. The third string is
the name of the file or directory.} the name of the file or directory.
Warning: the FTP protocol has no specification for the reply format, so
this information can be unreliable.}
@defproc[(ftp-make-file-seconds [ftp-date string?]) exact-integer?]{ @defproc[(ftp-make-file-seconds [ftp-date string?]) exact-integer?]{
Takes a date string produced by @racket[ftp-directory-list] and Takes a date string produced by @racket[ftp-directory-list] and
converts it to seconds (which can be used with converts it to seconds (which can be used with
@racket[seconds->date]).} @racket[seconds->date]).
Warning: the FTP protocol has no specification for the reply format, so
this information can be unreliable.}
@defproc[(ftp-download-file [ftp-conn ftp-connection?] @defproc[(ftp-download-file [ftp-conn ftp-connection?]