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
This commit is contained in:
Daniel Stenberg 2020-12-20 18:44:20 +01:00
parent e1a4647a42
commit a7696c7343
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
10 changed files with 49 additions and 4 deletions

View file

@ -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 */