<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 5, 2014 at 9:10 PM, Bradley Giesbrecht <span dir="ltr">&lt;<a href="mailto:pixilla@macports.org" target="_blank">pixilla@macports.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I&#39;m trying to write a function to return the remote file moddate. I copied isnewer and changed the end as so.<br>
...<br>
                theModDate = 0;<br>
<br>
        /* get the modification date */<br>
        theCurlCode = curl_easy_getinfo(theHandle, CURLINFO_FILETIME, &amp;theModDate);<br>
        if (theCurlCode != CURLE_OK) {<br>
            theResult = SetResultFromCurlErrorCode(interp, theCurlCode);<br>
            break;<br>
        }<br>
<br>
                (void) snprintf(theModDateString, sizeof(theModDateString),<br>
                        &quot;%Ld&quot;, theModDate);<br>
                Tcl_SetResult(interp, theModDateString, TCL_VOLATILE);<br>
<br>
...<br>
<br>
Is there anything obviously with the snprintf args, or anything else?<br>
It appears to always return &quot;-1&quot;;<br></blockquote></div><div class="gmail_extra"><br></div><div>-1 implies that it&#39;s curl_easy_getinfo that is failing, not the sprintf. The reasons for this can include things like (a) the web server doesn&#39;t support it, and (b) you didn&#39;t use curl_easy_setopt to specify beforehand to get the information (see <a href="http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html#CURLINFOFILETIME">http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html#CURLINFOFILETIME</a>).</div><div><br></div>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div></div>