tizen 2.3.1 release
[external/curl.git] / docs / libcurl / opts / CURLOPT_FTP_CREATE_MISSING_DIRS.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2014, 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 http://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_CREATE_MISSING_DIRS 3 "19 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_FTP_CREATE_MISSING_DIRS \- create missing dirs for FTP and SFTP
26 .SH SYNOPSIS
27 .nf
28 #include <curl/curl.h>
29
30 typedef enum {
31   CURLFTP_CREATE_DIR_NONE,
32   CURLFTP_CREATE_DIR,
33   CURLFTP_CREATE_DIR_RETRY
34 } curl_ftpcreatedir;
35
36 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_CREATE_MISSING_DIRS,
37                           long create);
38 .SH DESCRIPTION
39 Pass a long telling libcurl to \fIcreate\fP the dir. If the value is
40 \fICURLFTP_CREATE_DIR\fP (1), libcurl will attempt to create any remote
41 directory that it fails to "move" into.
42
43 For FTP requests, that means a CWD command fails. CWD being the command that
44 changes working directory.
45
46 For SFTP requests, libcurl will attempt to create the remote directory if it
47 can't obtain a handle to the target-location. The creation will fail if a file
48 of the same name as the directory to create already exists or lack of
49 permissions prevents creation.
50
51 Setting \fIcreate\fP to \fICURLFTP_CREATE_DIR_RETRY\fP (2), tells libcurl to
52 retry the CWD command again if the subsequent MKD command fails. This is
53 especially useful if you're doing many simultaneous connections against the
54 same server and they all have this option enabled, as then CWD may first fail
55 but then another connection does MKD before this connection and thus MKD fails
56 but trying CWD works!
57 .SH DEFAULT
58 CURLFTP_CREATE_DIR_NONE (0)
59 .SH PROTOCOLS
60 FTP and SFTP
61 .SH EXAMPLE
62 TODO
63 .SH AVAILABILITY
64 Added in 7.10.7. SFTP support added in 7.16.3. The retry option was added in
65 7.19.4.
66 .SH RETURN VALUE
67 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if the
68 create value is not.
69 .SH "SEE ALSO"
70 .BR CURLOPT_FTP_FILEMETHOD "(3), " CURLOPT_FTP_USE_EPSV "(3), "