Problem with CURLOPT_FILETIME
Date: Mon, 12 Nov 2007 14:39:20 -0800
Please excuse me if this an elementary question as I've just begun using
libcurl. I've read all the documentation and example programs that I
and have not been able to get my program to work as I'd like.
Basically I'd like to poll a web server to see if a file has been
since the last time I downloaded it. I'm trying to use the
function for this and cannot get it to work.
I'm using libcurl.so.3.0.0 on a RedHat 5.0.0 system.
Here's my test program:
int main(int argc, char **argv)
time_t fileTime = 1;
curl_handle = curl_easy_init();
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://curl.haxx.se"
curl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1 );
curl_easy_setopt(curl_handle, CURLOPT_FILETIME, &fileTime );
printf ( "Got file time %d - %s\n", fileTime, ctime(&fileTime));
No matter what I do, it does not appear to update my fileTime variable.
Got file time 1 - Wed Dec 31 16:00:01 1969
I've checked the return status on all of the calls (omitted here for
and none of the functions are returning any errors. I've also tried it
variety of web servers including our own in-house server and they all
the same way.
When I download the header and body of one of these locations the header
looks something like:
HTTP/1.1 200 OK
Date: Mon, 12 Nov 2007 21:38:10 GMT
Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8b
Last-Modified: Mon, 12 Nov 2007 21:04:34 GMT
which contains a "Last-Modified" date.
What am I doing wrong?
Received on 2007-11-12