aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-08-08 10:24:13 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-08-08 10:24:13 +0000
commite347d06a49d4ab09232e23db4578cc8fa46a139d (patch)
tree7bdae0e4455d48cc909c3fc67a9a70de3407964d /src/main.c
parent2077e9365afa94f4692083cf87fab1bf12e4298d (diff)
introducing --ftp-create_dirs
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index ff67810f0..5e912efd6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -403,7 +403,8 @@ static void help(void)
puts(" --connect-timeout <seconds> Maximum time allowed for connection\n"
" --create-dirs Create the necessary local directory hierarchy\n"
" --crlf Convert LF to CRLF in upload. Useful for MVS (OS/390)\n"
- " -f/--fail Fail silently (no output at all) on errors (H)\n"
+ " -f/--fail Fail silently (no output at all) on errors (H)");
+ puts(" --ftp-create-dirs Create the remote dirs if not present (F)\n"
" -F/--form <name=content> Specify HTTP POST data (H)\n"
" -g/--globoff Disable URL sequences and ranges using {} and []\n"
" -G/--get Send the -d data with a HTTP GET (H)");
@@ -540,6 +541,7 @@ struct Configurable {
bool use_httpget;
bool insecure_ok; /* set TRUE to allow insecure SSL connects */
bool create_dirs;
+ bool ftp_create_dirs;
char *writeout; /* %-styled format string to output */
bool writeenv; /* write results to environment, if available */
@@ -1085,6 +1087,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
#ifdef __DJGPP__
{"5p", "wdebug", FALSE},
#endif
+ {"5q", "ftp-create-dirs", FALSE},
{"0", "http1.0", FALSE},
{"1", "tlsv1", FALSE},
{"2", "sslv2", FALSE},
@@ -1334,6 +1337,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
dbug_init();
break;
#endif
+ case 'q': /* --ftp-create_dirs */
+ config->ftp_create_dirs ^= TRUE;
+ break;
default: /* the URL! */
{
@@ -3097,6 +3103,10 @@ operate(struct Configurable *config, int argc, char *argv[])
curl_easy_setopt(curl, CURLOPT_ENCODING,
(config->encoding) ? "" : NULL);
+ /* new in curl 7.10.7 */
+ curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS,
+ config->ftp_create_dirs);
+
res = curl_easy_perform(curl);
if((config->progressmode == CURL_PROGRESS_BAR) &&