Imported Upstream version 7.59.0
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_FTP_FILEMETHOD.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH CURLOPT_FTP_FILEMETHOD 3 "May 05, 2017" "libcurl 7.59.0" "curl_easy_setopt options"
24
25 .SH NAME
26 CURLOPT_FTP_FILEMETHOD \- select directory traversing method for FTP
27 .SH SYNOPSIS
28 .nf
29 #include <curl/curl.h>
30
31 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_FILEMETHOD,
32                           long method);
33 .SH DESCRIPTION
34 Pass a long telling libcurl which \fImethod\fP to use to reach a file on a
35 FTP(S) server.
36
37 This option exists because some server implementations aren't compliant to
38 what the standards say should work.
39
40 The argument should be one of the following alternatives:
41 .IP CURLFTPMETHOD_MULTICWD
42 libcurl does a single CWD operation for each path part in the given URL. For
43 deep hierarchies this means many commands. This is how RFC1738 says it should
44 be done. This is the default but the slowest behavior.
45 .IP CURLFTPMETHOD_NOCWD
46 libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a
47 full path to the server for all these commands. This is the fastest behavior.
48 .IP CURLFTPMETHOD_SINGLECWD
49 libcurl does one CWD with the full target directory and then operates on the
50 file \&"normally" (like in the multicwd case). This is somewhat more standards
51 compliant than 'nocwd' but without the full penalty of 'multicwd'.
52 .SH DEFAULT
53 CURLFTPMETHOD_MULTICWD
54 .SH PROTOCOLS
55 FTP
56 .SH EXAMPLE
57 .nf
58 CURL *curl = curl_easy_init();
59 if(curl) {
60   curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/1/2/3/4/new.txt");
61   curl_easy_setopt(curl, CURLOPT_FTP_FILEMETHOD,
62                          CURLFTPMETHOD_SINGLECWD);
63
64   ret = curl_easy_perform(curl);
65
66   curl_easy_cleanup(curl);
67 }
68 .fi
69 .SH AVAILABILITY
70 Added in 7.15.1
71 .SH RETURN VALUE
72 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
73 .SH "SEE ALSO"
74 .BR CURLOPT_DIRLISTONLY "(3), " CURLOPT_FTP_SKIP_PASV_IP "(3), "