~ubuntu-branches/ubuntu/jaunty/curl/jaunty-security

« back to all changes in this revision

Viewing changes to docs/examples/ftpgetresp.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-08-01 12:22:30 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070801122230-uaarmp6lo65py9t6
Tags: 7.16.4-1ubuntu1
* Merge with Debian.
  - Drop debian/patches/gnutls-verifications, applied upstream.
  - Remove all stuff which should be reverted according to 7.16.2-6ubuntu4.
  - Remaining change: drop stunnel build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
 
 *                                  _   _ ____  _     
3
 
 *  Project                     ___| | | |  _ \| |    
4
 
 *                             / __| | | | |_) | |    
5
 
 *                            | (__| |_| |  _ <| |___ 
 
2
 *                                  _   _ ____  _
 
3
 *  Project                     ___| | | |  _ \| |
 
4
 *                             / __| | | | |_) | |
 
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * $Id: ftpgetresp.c,v 1.2 2003/12/08 14:13:19 bagder Exp $
 
8
 * $Id: ftpgetresp.c,v 1.3 2007-07-06 20:14:03 bagder Exp $
9
9
 */
10
10
 
11
11
#include <stdio.h>
34
34
  CURLcode res;
35
35
  FILE *ftpfile;
36
36
  FILE *respfile;
37
 
  
 
37
 
38
38
  /* local file name to store the file as */
39
39
  ftpfile = fopen("ftp-list", "wb"); /* b is binary, needed on win32 */
40
40
 
46
46
    /* Get a file listing from sunet */
47
47
    curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.sunet.se/");
48
48
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile);
 
49
    /* If you intend to use this on windows with a libcurl DLL, you must use
 
50
       CURLOPT_WRITEFUNCTION as well */
49
51
    curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_response);
50
52
    curl_easy_setopt(curl, CURLOPT_WRITEHEADER, respfile);
51
53
    res = curl_easy_perform(curl);