Description
This function creates a new directory.
Examples
LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$create_directory = $cpanel->api1('Fileman', 'fmmkdir', array('public_html', 'directory')); // Call the function.
LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $create_directory = $cpliveapi->api1('Fileman', 'fmmkdir' ['public_html', 'directory']); # Call the function.
cPanel Tag System (deprecated)
Warning:
In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. This example is present in order to help developers move from the old cPanel tag system to our LiveAPI.
We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.
<cpanel Module="Fileman::fmmkdir ( $FORM('dir','file'))">
Command Line
cpapi1 --user=username Fileman fmkdir dir=public_html file=directory
Output (plaintext)
Created /home/USER/DIRECTORY
Parameters
Parameter
|
Type
|
Description
|
Possible values
|
Example
|
dir
|
string
|
Required
The new directory's parent directory.
|
Any valid directory name on the server.
|
public_html
|
file
|
string
|
Required
The new directory name.
|
Any valid directory name.
|
directory
|
Returns
This function returns a message of success with the new directory's path from the /home
directory.