Description
This function creates a directory.
Warning:
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
path |
string |
Required The new directory's path. |
The absolute path to a location on the server. |
/home/user/public_html/ |
name |
string |
Required The new directory's name. |
A valid directory name. |
new_directory |
permissions |
string |
The new directory's file permissions. |
A valid octal string. |
0755 |
Returns
Return
|
Type
|
Description
|
Possible values
|
Example
|
---|---|---|---|---|
permissions |
string | The new directory's file permissions. | A valid octal string. | 0755 |
name |
string |
The new directory's name. |
A valid directory name. |
new_directory |
path |
string | The new directory's path. | The absolute path to a location on the server. |
/home/example/public_html |
reason |
string |
A reason for failure Note: This function only returns a |
A string that describes the error. | This is an error message. |
result |
boolean |
Whether the function succeeded. |
|
1 |