Description
This function returns the information for a specified file or directory.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameters |
Type |
Description |
Possible values |
Example |
path |
string |
Required The directory from which to list files. |
A valid directory, relative to the user's home directory. |
public_html |
show_hidden |
Boolean |
Whether to include hidden files in the output. This parameter defaults to 0. |
|
1 |
check_for_leaf_directories |
Boolean |
Whether to flag directories that contain subdirectories. This parameter defaults to 0. |
|
1 |
include_mime |
Boolean |
Whether to return the file's MIME type. This parameter defaults to 0. |
|
1 |
include_hash |
Boolean |
Whether to return a hash of the file's information. This parameter defaults to 0. |
|
0 |
include_permissions |
Boolean |
Whether to parse the file owner's read and write permissions. This parameter defaults to 0. |
|
0 |
Returns
Return |
Type |
Description |
Possible values |
Example |
absdir |
string |
The path to the user's home directory. |
A valid filepath. |
/home/user |
ctime |
string |
The file's creation time. |
A time in Unix time format. |
1400573272 |
exists |
Boolean |
Whether the file exists in the directory. |
|
1 |
file |
string |
The filename. |
A valid filename on the server. |
cgi-bin |
fullpath |
string |
The file's full filepath. |
A valid filepath on the server. |
/home/user/public_html/cgi-bin |
gid |
integer |
The file owner's system group ID. |
A positive integer. |
503 |
hash |
string |
The full filepath's hash. |
A string of letters and integers. |
L2hvbWUvY29saW4vcHVibGljX2h0bWw |
humansize |
string |
The formatted size of the file. |
A positive integer and one of the following symbols:
|
5 KB |
isleaf |
Boolean |
Whether the directory contains subdirectories. |
|
1 |
mimetype |
string |
The file's MIME type. |
A valid MIME type. |
text/plain |
mode |
string |
The file's textual permissions |
A string value, in Unix format. |
16872 |
mtime |
string |
The file's last modification time. |
A time in Unix time format. |
1400573272 |
nicemode |
integer |
The file's numerical permissions. |
An integer value, in octal notation. |
0755 |
path |
string |
The file's path. |
A valid file path. |
/home/user/public.html |
phash |
string |
The parent filepath's file hash. |
A string of letters and integers. |
L2hvbWUvY29saW4vcHVibGljX2h0bWw |
rawmimetype |
string |
The file's raw MIME type. |
A valid raw MIME type on the server. |
text/plain |
size |
integer |
The file's size. |
A positive integer, measured in bytes. |
4096 |
type |
string |
The item's type. |
|
file |
uid |
integer |
The file owner's system user ID. |
A positive integer. |
502 |
read |
Boolean |
Whether the file is readable. The function only returns this value if you set the include_permissions value to 1. |
|
1 |
write |
Boolean |
Whether the file is writable. The function only returns this value if you set the include_permissions value to 1. |
|
1 |