curl-library
Re: Problem of implementing ftp client--getRootPath()
Date: Thu, 26 Aug 2010 11:01:29 -0500
On Thu, Aug 26, 2010 at 9:54 AM, HU Chengzhe wrote:
> My code is as follow:
> ...
> curl_easy_setopt(curl, CURLOPT_URL, "ftp://199.52.234.12");
Unless you are downloading a file, the URL should have a trailing slash:
curl_easy_setopt(curl, CURLOPT_URL, "ftp://199.52.234.12/");
> ...
> char str[100];
> res = curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, str);
The documentation says "Pass a pointer to a char pointer"
Instead you are passing a char array.
Do this instead:
char *str=NULL;
res = curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &str);
- Jeff
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-08-26