1CURLOPT_FTP_FILEMETHOD(3)  curl_easy_setopt options  CURLOPT_FTP_FILEMETHOD(3)
2
3
4

NAME

6       CURLOPT_FTP_FILEMETHOD - select directory traversing method for FTP
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_FILEMETHOD,
12                                 long method);
13

DESCRIPTION

15       Pass  a  long  telling libcurl which method to use to reach a file on a
16       FTP(S) server.
17
18       This option exists because some server implementations are not  compli‐
19       ant to what the standards say should work.
20
21       The argument should be one of the following alternatives:
22
23       CURLFTPMETHOD_MULTICWD
24              libcurl  does  a  single CWD operation for each path part in the
25              given URL. For deep hierarchies this means many  commands.  This
26              is  how  RFC1738 says it should be done. This is the default but
27              the slowest behavior.
28
29       CURLFTPMETHOD_NOCWD
30              libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc
31              and  give a full path to the server for all these commands. This
32              is the fastest behavior.
33
34       CURLFTPMETHOD_SINGLECWD
35              libcurl does one CWD with the full target directory and then op‐
36              erates  on the file "normally" (like in the multicwd case). This
37              is somewhat more standards compliant than  'nocwd'  but  without
38              the full penalty of 'multicwd'.
39

DEFAULT

41       CURLFTPMETHOD_MULTICWD
42

PROTOCOLS

44       FTP
45

EXAMPLE

47       CURL *curl = curl_easy_init();
48       if(curl) {
49         curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/1/2/3/4/new.txt");
50         curl_easy_setopt(curl, CURLOPT_FTP_FILEMETHOD,
51                                CURLFTPMETHOD_SINGLECWD);
52
53         ret = curl_easy_perform(curl);
54
55         curl_easy_cleanup(curl);
56       }
57

AVAILABILITY

59       Added in 7.15.1
60

RETURN VALUE

62       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
63       if not.
64

SEE ALSO

66       CURLOPT_DIRLISTONLY(3), CURLOPT_FTP_SKIP_PASV_IP(3),
67
68
69
70libcurl 7.85.0                   May 17, 2022        CURLOPT_FTP_FILEMETHOD(3)
Impressum