From 2757ab7d153a99218d2533d7404edb84a0c08a5a Mon Sep 17 00:00:00 2001 From: Eli Barzilay <eli@barzilay.org> Date: Fri, 5 Aug 2011 01:13:50 -0400 Subject: [PATCH] Add an optional path argument to `ftp-directory-list'. original commit: 5a7ddd66114035237e29f76d9632775b9c38810c --- collects/net/ftp-unit.rkt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/collects/net/ftp-unit.rkt b/collects/net/ftp-unit.rkt index 7a80f7c..de4531b 100644 --- a/collects/net/ftp-unit.rkt +++ b/collects/net/ftp-unit.rkt @@ -163,9 +163,11 @@ "^(.)(.*) ((?i:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)" " .* [0-9][0-9]:?[0-9][0-9]) (.*)$"))) -(define (ftp-directory-list tcp-ports) +(define (ftp-directory-list tcp-ports [path #f]) (define tcp-data (establish-data-connection tcp-ports)) - (fprintf (ftp-connection-out tcp-ports) "LIST\r\n") + (if path + (fprintf (ftp-connection-out tcp-ports) "LIST ~a\r\n" path) + (fprintf (ftp-connection-out tcp-ports) "LIST\r\n")) (ftp-check-response (ftp-connection-in tcp-ports) (ftp-connection-out tcp-ports) (list #"150" #"125") void (void))