> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Daniel Stenberg
> Sent: Wednesday, November 11, 2009 3:10 AM
> To: libcurl development
> Subject: Re: response to quoted pwd command in libcurl
> 
> On Tue, 10 Nov 2009, Xu, Qiang (FXSGSC) wrote:
> 
> > The command seems to be successful, but I can only see the 
> > destination directory's content listing. How can I retrieve the 
> > result of the quoted command "pwd", both by curl command 
> > and by libcurl?
> 
> It is sent as a header, so use the header callback for that.

Is there a possibility that this header dump is not supported?
====================================================
q...@durian(pts/1):~/opensrc/curl-7.19.6/src[138]$ rm saveHeader.txt

q...@durian(pts/1):~/opensrc/curl-7.19.6/src[139]$ touch saveHeader.txt

q...@durian(pts/1):~/opensrc/curl-7.19.6/src[140]$ ll saveHeader.txt
-rw-rw-r-- 1 qxu XOG_cc 0 Nov 12 19:16 saveHeader.txt

q...@durian(pts/1):~/opensrc/curl-7.19.6/src[141]$ ./curl -u qxu:fair123 
ftp://13.198.98.202/scan/ -Q "-PWD" -D saveHeader.txt
total 112
-rwxr-xr-x   1 qxu      XOG_cc       131 Nov  2 11:56 ren1.sh
-rwxr-xr-x   1 qxu      XOG_cc        88 Nov  5 16:15 ren2.sh
-rwxr-xr-x   1 qxu      XOG_cc       560 Nov  5 16:13 ren3.pl
drwxrwxr-x   2 qxu      XOG_cc      7168 Nov  5 16:14 sxc
-rw-r--r--   1 qxu      XOG_cc      2106 Nov  6 18:29 test.txt
-rw-r--r--   1 qxu      XOG_cc      2106 Nov 12 14:26 test1.txt
-rw-r--r--   1 qxu      XOG_cc      2106 Nov 12 14:26 test2.txt

q...@durian(pts/1):~/opensrc/curl-7.19.6/src[142]$ ll saveHeader.txt
-rw-rw-r-- 1 qxu XOG_cc 530 Nov 12 19:16 saveHeader.txt

q...@durian(pts/1):~/opensrc/curl-7.19.6/src[143]$ vi saveHeader.txt
--------------------------------------------------
220 gso-prolix FTP server ready.
331 Password required for qxu.
230 User qxu logged in.
257 "/home/qxu" is current directory.
250 CWD command successful.
229 Entering Extended Passive Mode (|||25062|)
200 Type set to A.
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
257 "/home/qxu/scan" is current directory.
221-You have transferred 0 bytes in 0 files.
221-Total traffic for this session was 895 bytes in 1 transfers.
221-Thank you for using the FTP service on gso-prolix.
221 Goodbye.
====================================================
Thus, it seems -D option is effective for FTP, but not for SFTP. Is it that 
this -D option is not implemented in curl for SFTP, or is it a defect of 
libssh2?

Thanks,
Xu Qiang
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to