cURL
Haxx ad
libcurl

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

RE: response to quoted pwd command in libcurl

From: Xu, Qiang (FXSGSC) <Qiang.Xu_at_fujixerox.com>
Date: Wed, 11 Nov 2009 16:59:45 +0800

> -----Original Message-----
> From: curl-library-bounces_at_cool.haxx.se
> [mailto:curl-library-bounces_at_cool.haxx.se] 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.

From http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTQUOTE and http://curl.haxx.se/libcurl/c/libcurl-tutorial.html, I guess the code should be somewhat wrtten like the following:
========================================================
CURL *handle = NULL;
struct curl_slist *headers;
...
handle = curl_easy_init();
...
curl_easy_setopt(CURLOPT_URL, "sftp://13.198.98.190/");
...
headers = curl_slist_append(headers, "pwd");
curl_easy_setopt(handle, CURLOPT_QUOTE, headers);
curl_easy_setopt(handle, CURLOPT_HEADER, 1); /* A parameter set to 1 tells the library to include the header in the body output */
...
curl_easy_perform(handle);
...
curl_slist_free_all(headers);
curl_easy_cleanup(handle);
========================================================
Does the above code look good? If there is anything wrong in it, pls point it out to me.

By the way, what is the command-line option to use to have the same effect as "curl_easy_setopt(handle, CURLOPT_HEADER, 1)"?

Thanks,
Xu Qiang

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-11

These mail archives are generated by hypermail.

donate! Page updated November 16, 2009.
web site info

File upload with ASP.NET