cURL / Mailing Lists / curl-library / Single Mail

curl-library

About getting file attibutes on FTP server using libcurl

From: CHEN Xiaolei A <Xiaolei.a.Chen_at_alcatel-sbell.com.cn>
Date: Thu, 26 Aug 2010 10:37:00 +0800

Hello,

   I am using libcurl to implement FTP manipulations, and I got a problem when trying retrieving file attributes on FTP server.

   My solutions for retrieving file attributes listed below:
   (1) List dir and dump the result to memory
        curl_easy_setopt(curl, CURLOPT_URL, "ftp://135.252.13.96/");
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, MyMemoStruct);
        ...
        curl_easy_perform(curl);
  
        So the result (something like executing "ls -l") will be stored in memory

  (2) Parse the memory string and get file attributes like "owner", "permission", "size", etc.

   My question is:
   (1) If filename contains some special character in UTF-8 format, can the mothod above work well? If the filename become a clobber, and I use this clobber to download this file, can libcurl work well?
   (2) Is there any other way to retrieve file attributes?

   Thanks a lot.

Regards,
-----------------------------------------------------------------------
Chen Xiaolei(С)
oambase-wtk Team
Telephone: +86 10 8477 7636
Mail: Xiaolei.a.Chen_at_alcatel-sbell.com.cn
-----------------------------------------------------------------------

   

     
 
        
                     

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