guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: ftp-client: Allow custom username and password for FTP servers.


From: Roel Janssen
Subject: 01/02: ftp-client: Allow custom username and password for FTP servers.
Date: Tue, 21 Mar 2017 07:15:54 -0400 (EDT)

roelj pushed a commit to branch master
in repository guix.

commit 193420a80319ed72db511b2d3d3cec62fc941d17
Author: Roel Janssen <address@hidden>
Date:   Tue Mar 21 12:14:05 2017 +0100

    ftp-client: Allow custom username and password for FTP servers.
    
    * guix/ftp-client.scm (ftp-open): Add username and password arguments.
---
 guix/ftp-client.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/guix/ftp-client.scm b/guix/ftp-client.scm
index 0a17928..054a00a 100644
--- a/guix/ftp-client.scm
+++ b/guix/ftp-client.scm
@@ -121,7 +121,10 @@ seconds to wait for the connection to succeed."
              (raise-error errno)))))
       (connect s sockaddr)))
 
-(define* (ftp-open host #:optional (port "ftp") #:key timeout)
+(define* (ftp-open host #:optional (port "ftp")
+                        #:key timeout
+                              (username "anonymous")
+                              (password "address@hidden"))
   "Open an FTP connection to HOST on PORT (a service-identifying string,
 or a TCP port number), and return it.
 
@@ -156,7 +159,7 @@ TIMEOUT, an ETIMEDOUT error is raised."
                (if (eqv? code 220)
                    (begin
                      ;;(%ftp-command "OPTS UTF8 ON" 200 s)
-                     (%ftp-login "anonymous" "address@hidden" s)
+                     (%ftp-login username password s)
                      (%make-ftp-connection s ai))
                    (begin
                      (close s)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]