1CURLOPT_NEW_DIRECTORY_PERMS(c3u)rl_easy_setopt optioCnUsRLOPT_NEW_DIRECTORY_PERMS(3)
2
3
4

NAME

6       CURLOPT_NEW_DIRECTORY_PERMS - permissions for remotely created directo‐
7       ries
8

SYNOPSIS

10       #include <curl/curl.h>
11
12       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NEW_DIRECTORY_PERMS,
13                                 long mode);
14

DESCRIPTION

16       Pass a long as a parameter, containing the  value  of  the  permissions
17       that  will  be  assigned  to  newly  created  directories on the remote
18       server.  The default value is 0755, but any valid value  can  be  used.
19       The only protocols that can use this are sftp://, scp://, and file://.
20

DEFAULT

22       0755
23

PROTOCOLS

25       SFTP, SCP and FILE
26

EXAMPLE

28       CURL *curl = curl_easy_init();
29       if(curl) {
30         CURLcode ret;
31         curl_easy_setopt(curl, CURLOPT_URL, "sftp://upload.example.com/newdir/file.zip");
32         curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);
33         curl_easy_setopt(curl, CURLOPT_NEW_DIRECTORY_PERMS, 0644L);
34         ret = curl_easy_perform(curl);
35       }
36

AVAILABILITY

38       Added in 7.16.4
39

RETURN VALUE

41       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
42       if not.
43

SEE ALSO

45       CURLOPT_NEW_FILE_PERMS(3), CURLOPT_UPLOAD(3),
46
47
48
49libcurl 7.69.1                   May 31, 2017   CURLOPT_NEW_DIRECTORY_PERMS(3)
Impressum