On Sep 5, 2014, at 6:26 PM, Brandon Allbery <[email protected]> wrote:
> 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). That was it! The url was not valid. Thanks for helping me understand where the error was coming from. Regards, Bradley Giesbrecht (pixilla)
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ macports-dev mailing list [email protected] https://lists.macosforge.org/mailman/listinfo/macports-dev
