Description
This function checks whether a directory is empty.
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
| Input | Type | Description | Possible values | Example | 
| dir | string | Required The directory's file path. | Any valid file path. | /home/user/public_html/subdomain/ | 
| files_only | boolean | Whether to return only directories that contain files as not empty. | 
 | 1 | 
| regex_ext | string | A Perl Compatible Regular Expression (PCRE) that filters the results by file extension. | A valid PCRE. | \.txt | 
Returns
| Input | Type | Description | Possible values | Example | 
| dir | string | Required The directory's file path. | Any valid file path. | /home/user/public_html/subdomain/ | 
| files_only | boolean | Whether to return only directories that contain files as not empty. | 
 | 1 | 
| regex_ext | string | A Perl Compatible Regular Expression (PCRE) that filters the results by file extension. | A valid PCRE. | \.txt | 
