From 55405d017bd99c21a42166a75219a47902526ffe Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 4 Aug 2011 23:24:50 -0400 Subject: [PATCH] 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: 234015b34d43a602dfcabe9365de9027531c2f9f --- collects/net/scribblings/ftp.scrbl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/collects/net/scribblings/ftp.scrbl b/collects/net/scribblings/ftp.scrbl index ef2c263bde..9f76d73121 100644 --- a/collects/net/scribblings/ftp.scrbl +++ b/collects/net/scribblings/ftp.scrbl @@ -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 value to seconds consistent with @racket[file-seconds], pass the date 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?]{ Takes a date string produced by @racket[ftp-directory-list] and 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?]