On 29-Jun-06, at 6:05 PM, Daniel Stenberg wrote:
> On Thu, 29 Jun 2006, Eric Kneisel wrote:
>
>> I cannot figure out a way to get the date/time stamp for a file on
>> the FTP server.
>
> I don't know with curlpp, but with plain libcurl you use
> CURLOPT_FILETIME:
>
> http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTFILETIME
>
Dan Thanks for getting back to me about this. I'd figured that part out,
and I apologize for not making my request clearer. I've got the setup as
follows:
curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_USERPWD, user + ':' + pass);
curl_easy_setopt(curl, CURLOPT_PROXY, proxyHost);
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, proxyUser + ':' + proxyPass);
curl_easy_setopt(curl, CURLOPT_FILETIME, 1);
what I want to be able to do is to check the date/time of the file located
on the remote server, and if its newer than the local copy, to download it.
It is the check part that I am confused about, the easy_perform will
download the file(and as I understand it once I download it locally I'll be
looking at the creation date of the local copy and not the copy on the
remote server).
The Curl site says:
CURLINFO_FILETIME
Pass a pointer to a long to receive the remote time of the retrieved
document (in number of seconds since 1 jan 1970 in the GMT/UTC time zone).
If you get -1, it can be because of many reasons (unknown, the server hides
it or the server doesn't support the command that tells document time etc)
and the time of the document is unknown. Note that you must tell the server
to collect this information before the transfer is made, by using the
CURLOPT_FILETIME option to curl_easy_setopt(3) or you will unconditionally
get a -1 back. (Added in 7.5)
My question I suppose is what function is it saying to pass the pointer to a
long into. The easy_perform fuction doesn't seem to take a pointer to a
long, and downloads the file ontop of that.
Thank you very much for your time in this matter.
Eric
_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2006-07-03