summaryrefslogtreecommitdiff
path: root/src/tool_getparam.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-12-20 18:44:20 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-21 10:52:41 +0100
commita7696c73436f643d5d31ce0c3d48d282c79f4b5d (patch)
treec01a633a45e06f199eba2cd295b60725af7800c0 /src/tool_getparam.c
parente1a4647a42b901d88f9629ce98ff56960e342a74 (diff)
downloadcurl-a7696c73436f643d5d31ce0c3d48d282c79f4b5d.tar.gz
curl: add --create-file-mode [mode]
This option sets the (octal) mode to use for the remote file when one is created, using the SFTP, SCP or FILE protocols. When not set, the default is 0644. Closes #6244
Diffstat (limited to 'src/tool_getparam.c')
-rw-r--r--src/tool_getparam.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index b7cfeb62e..c57506609 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -108,6 +108,7 @@ static const struct LongShort aliases[]= {
#endif
{"*q", "ftp-create-dirs", ARG_BOOL},
{"*r", "create-dirs", ARG_BOOL},
+ {"*R", "create-file-mode", ARG_STRING},
{"*s", "max-redirs", ARG_STRING},
{"*t", "proxy-ntlm", ARG_BOOL},
{"*u", "crlf", ARG_BOOL},
@@ -774,6 +775,12 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
config->create_dirs = toggle;
break;
+ case 'R': /* --create-file-mode */
+ err = oct2nummax(&config->create_file_mode, nextarg, 0777);
+ if(err)
+ return err;
+ break;
+
case 's': /* --max-redirs */
/* specified max no of redirects (http(s)), this accepts -1 as a
special condition */