cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl-library

From: Jeff Pohlmeyer <yetanothergeek_at_gmail.com>
Date: Wed, 20 Aug 2014 04:26:29 -0500

On Wed, Aug 20, 2014 at 3:57 AM, Koka Leela Siva Kumar wrote:

> I want to get the list of files from the remote ftp server.
> can you please help me regarding this.

> string post_cmd_delete;
> struct curl_slist *list = NULL;
>
> curl_easy_setopt (m_curl_handle,CURLOPT_URL,
> "ftp://10.xx.xxx.xx/~/cdrtest");

> post_cmd_delete = "ls *cscf1* | sort | tail -2";
> list = curl_slist_append(list, post_cmd_delete.c_str());
> curl_easy_setopt(m_curl_handle, CURLOPT_QUOTE, list);

You don't need post_cmd_delete or curl_slist or curl_slist_append or
CURLOPT_QUOTE.

Just make sure your CURLOPT_URL ends with a trailing slash, and
libcurl will know what to do.
e.g. "ftp://10.xx.xxx.xx/~/cdrtest/"

As far as sorting the list or grabbing only certain entries, that is something
that would probably be better to handle locally after "data1.txt" is received.

 - Jeff
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-08-20