[cl-curl-devel] usage help

I'm trying to understand how to use curl with sbcl 0.9.7. The only thing I've managed to get so far is a listing. (curl:with-connection-returning-string (:reassure t) (curl:set-option :url "ftp://user-name:password@192.168.0.1") (curl:set-option :verbose t) (curl:set-option :ftplistonly nil) (curl:perform) (pprint (curl:return-string)) I tried (curl:with-connection-returning-string (:reassure t) (curl:set-option :url "ftp://user-name:password@192.168.0.1") (curl:set-option :verbose t) (curl:set-option :quote "CWD") (curl:perform) and I get * About to connect() to 192.168.0.1 port 21 * Trying 192.168.0.1... * connected * Connected to 192.168.0.1 (192.168.0.1) port 21 < 220 (vsFTPd 2.0.1) > USER user-name < 331 Please specify the password. > PASS password < 230 Login successful. * We have successfully logged in > PWD < 257 "/home/user-name" * Entry path is '/home/user-name' > ]u}]VHe= < 500 Unknown command. * QUOT string not accepted: ]u}]VHe= * Connection #0 to host 192.168.0.1 left intact debugger invoked on a SIMPLE-ERROR in thread #<THREAD "initial thread" {A91C3A9}>: CURL error 21 (FTP-QUOTE-ERROR) Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit debugger, returning to top level. (CURL::RETURN-ERROR-CHECK 21) 0] Can someone provide examples of other commands such as mkd, pwd, cwd and transfering files using ftp? Thanks Richard

Richard, I've not ever tried cl-curl with ftp, so I can't provide a successful example. The commands you use look reasonable to me. It seems to be getting gibberish after setting the path, but I don't know why. The debugging step that comes to mind is to try the C interface to libcurl, and see what makes a successful connection to the ftp server. Then we can try to trace it back to the CL interface and maybe that will give us a clue. Liam
"Richard" == Richard Ray <rray@mstc.state.ms.us> writes:
Richard> I'm trying to understand how to use curl with sbcl 0.9.7. Richard> The only thing I've managed to get so far is a listing. Richard> (curl:with-connection-returning-string (:reassure t) Richard> (curl:set-option :url "ftp://user-name:password@192.168.0.1") Richard> (curl:set-option :verbose t) Richard> (curl:set-option :ftplistonly nil) Richard> (curl:perform) Richard> (pprint (curl:return-string)) Richard> I tried Richard> (curl:with-connection-returning-string (:reassure t) Richard> (curl:set-option :url "ftp://user-name:password@192.168.0.1") Richard> (curl:set-option :verbose t) Richard> (curl:set-option :quote "CWD") Richard> (curl:perform) Richard> and I get Richard> * About to connect() to 192.168.0.1 port 21 Richard> * Trying 192.168.0.1... * connected Richard> * Connected to 192.168.0.1 (192.168.0.1) port 21 Richard> < 220 (vsFTPd 2.0.1) >> USER user-name Richard> < 331 Please specify the password. >> PASS password Richard> < 230 Login successful. Richard> * We have successfully logged in >> PWD Richard> < 257 "/home/user-name" Richard> * Entry path is '/home/user-name' >> ]u}]VHe= Richard> < 500 Unknown command. Richard> * QUOT string not accepted: ]u}]VHe= Richard> * Connection #0 to host 192.168.0.1 left intact Richard> debugger invoked on a SIMPLE-ERROR in thread Richard> #<THREAD "initial thread" {A91C3A9}>: Richard> CURL error 21 (FTP-QUOTE-ERROR) Richard> Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. Richard> restarts (invokable by number or by possibly-abbreviated name): Richard> 0: [ABORT] Exit debugger, returning to top level. Richard> (CURL::RETURN-ERROR-CHECK 21) Richard> 0] Richard> Can someone provide examples of other commands such as mkd, pwd, cwd and Richard> transfering files using ftp? Richard> Thanks Richard> Richard Richard> _______________________________________________ Richard> cl-curl-devel mailing list Richard> cl-curl-devel@common-lisp.net Richard> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-curl-devel
participants (2)
-
Liam M. Healy
-
Richard Ray