cURL / Mailing Lists / curl-library / Single Mail


Re: State of things for release?

From: Jeff Pohlmeyer <>
Date: Wed, 30 Jul 2008 14:17:36 -0500

Dan Fandrich wrote:

> Simply put, do a complete ftp transaction with CURLOPT_NOBODY set to 1 to
> check the existence of the file, check the error code, then do a new one
> (with the same handle) with CURLOPT_NOBODY set to 0 to actually transfer
> the file.

I just tried it here, and it looks like CURLOPT_NOBODY
returns CURLE_OK even if the file doesn't exist, even
when CURLOPT_FAILONERROR is set. I also tried testing
the CURLINFO_RESPONSE_CODE and I am getting 350 in
either case, libcurl still sends REST even after a 550
response to SIZE. This was just a quick test, maybe I got
something wrong:

#include <curl/curl.h>

int main(int argc, char*argv[])
  int rv;
  long resp;
  curl_easy_setopt(curl,CURLOPT_URL, argv[1]);
  curl_easy_setopt(curl,CURLOPT_NOBODY, 1);
  curl_easy_setopt(curl,CURLOPT_VERBOSE, 1);
  curl_easy_setopt(curl,CURLOPT_FAILONERROR, 1);
  printf("rv=%d resp=%d\n", rv, resp);
  curl_easy_setopt(curl,CURLOPT_UPLOAD, 1);
  curl_easy_setopt(curl,CURLOPT_NOBODY, 0);

 - Jeff
Received on 2008-07-30