cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: FTP SIZE Command

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 30 Sep 2004 20:21:44 +0200 (CEST)

On Thu, 30 Sep 2004, Michael Smith wrote:

> Thanks for the reply.
>
> This helpful but seems clumsy to have to parse the header for the result,
> however I will go with it for my initial work.

Right, but that's the only way to read "raw" FTP server responses with
libcurl.

libcurl will use SIZE on its own before all file transfers and you can figure
out the size using the progress callback or...
CURLINFO_CONTENT_LENGTH_DOWNLOAD I believe.

> In addition to this is there anyway I can get a precise last write timestamp
> of a file on the FTP server.

If the FTP server supports MDTM, you can use CURLOPT_FILETIME:

    http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTFILETIME

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-09-30