curl-library
can't get NLST of a directory
Date: Wed, 24 Jan 2007 08:35:41 -0500
After looking through curl forums
I found that the best solution to do NLST
is to specify the URL of the directory, and
then do CURLOPT_CUSTOMREQUEST with NLST
the code below is what I am using. For some reason
ftp server (I use Filezilla) tells me that ".svn" is not a file
and it cannot download it. On the other hand
if I specify some file in the URL, then curl starts downloading.
This is not what I want at all. I just want to get what is inside of
directory, if URL points to a directory and fail if it points to a file.
here is the code that I use.
curl_global_init(CURL_GLOBAL_DEFAULT);
pCurl = curl_easy_init();
curl_easy_setopt(pCurl, CURLOPT_CUSTOMREQUEST, "NLST");
curl_easy_setopt(pCurl, CURLOPT_URL, "ftp://user:password@localhost/.svn/");
curl_easy_perform(pCurl);
curl_easy_cleanup(pCurl);
curl_global_cleanup();
Thank you very much for your help.
Stas.
Received on 2007-01-24