cURL / Mailing Lists / curl-library / Single Mail

curl-library

how to get ftp directories' and files' info [c language curl program]

From: 小俞同学 <yujinglei_1222_at_yahoo.com.cn>
Date: Tue, 9 Jun 2009 16:36:47 +0800 (CST)

part of my code is as follows:
------------------------------------------------------------
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
 
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "LIST");
  curl_easy_setopt(curl, CURLOPT_URL, ftp://ftp2.****.com/);
   
  res = curl_easy_perform(curl);
   
  if(CURLE_OK != res) {
   /* we failed */
   fprintf(stderr, "curl told us %d\n", res);
  }   
curl_easy_cleanup(curl);
}

curl_global_cleanup();
----------------------------------------------------------
I just get the ftp directories and files from the console[ I use curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); ]
 
but I don't know how to get the ftp directories info into my code, such as files' names, directories' names, and then I'll download the files.
 
So can someone help me?
 
  ___________________________________________________________ 好玩贺卡等你发,邮箱贺卡全新上线! http://card.mail.cn.yahoo.com/
Received on 2009-06-09