cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: reg:Disable the output option in libcurl

From: <nagarajan.sreenivasan_at_wipro.com>
Date: Thu, 26 Jun 2008 17:03:14 +0530

 
Hi

> Then In case I have to reuse a coonection then seeing the whole
> directory listing makes a Messy look on the screen .

>>So why do you do a directory listing in the first place if you don't
want to list the contents of that directory?

I am just doing a Connect in ftp mode (the below code). I am geeting the
directory listing which I don't want . How
Do I switch off.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++

#include <stdio.h>

#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>

/*
 * This is an example showing how to get a single file from an FTP
server.
 * It delays the actual destination file creation until the first write
 * callback so that it won't create an empty file in case the remote
file
 * doesn't exist or something else fails.
 */

int main(void)
{
  CURL *curl;
  CURLcode res;

  curl_global_init(CURL_GLOBAL_DEFAULT);

  curl = curl_easy_init();
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_FTPPORT, "-");
    curl_easy_setopt(curl, CURLOPT_URL,
                     "ftp:/username:password@<hostname>/");
     curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
    res = curl_easy_perform(curl);

    curl_easy_cleanup(curl);

    if(CURLE_OK != res) {
      fprintf(stderr, "curl told us %d\n", res);
    }
  }

  curl_global_cleanup();

  return 0;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++

Regards
Nagarajan

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com
Received on 2008-06-26