On Fri, Sep 5, 2014 at 9:10 PM, Bradley Giesbrecht <[email protected]>
wrote:
> I'm trying to write a function to return the remote file moddate. I copied
> isnewer and changed the end as so.
> ...
> theModDate = 0;
>
> /* get the modification date */
> theCurlCode = curl_easy_getinfo(theHandle, CURLINFO_FILETIME,
> &theModDate);
> if (theCurlCode != CURLE_OK) {
> theResult = SetResultFromCurlErrorCode(interp, theCurlCode);
> break;
> }
>
> (void) snprintf(theModDateString, sizeof(theModDateString),
> "%Ld", theModDate);
> Tcl_SetResult(interp, theModDateString, TCL_VOLATILE);
>
> ...
>
> Is there anything obviously with the snprintf args, or anything else?
> It appears to always return "-1";
>
-1 implies that it's curl_easy_getinfo that is failing, not the sprintf.
The reasons for this can include things like (a) the web server doesn't
support it, and (b) you didn't use curl_easy_setopt to specify beforehand
to get the information (see
http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html#CURLINFOFILETIME).
--
brandon s allbery kf8nh sine nomine associates
[email protected] [email protected]
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev