# Return file or directory information

This function returns the information for a specified file or directory.

Important:

When you disable the File Storage role, the system disables this function.

Endpoint: GET /Fileman/get_file_information
Version: 11.136.0.4
Security: BasicAuth

## Query parameters:

  - `path` (string, required)
    The directory from which to list files.
    Example: "public_html"

  - `check_for_leaf_directories` (integer)
    Whether to flag directories that contain subdirectories.

* 1 - Flag directories that contain subdirectories.
* 0 - Do not flag directories that contain subdirectories.
    Enum: 0, 1

  - `include_mime` (integer)
    Whether to return the file's MIME type.

* 1 - Return the file's MIME type.
* 0 - Do not return the file's MIME type.
    Enum: 0, 1

  - `include_permissions` (integer)
    Whether to parse the file owner's read and write permissions.

* 1 - Parse the file owner's read and write permissions.
* 0 - Do not parse the file owner's read and write permissions.
    Enum: 0, 1

  - `show_hidden` (integer)
    Whether to include hidden files in the output.

* 1 - Include hidden files.
* 0 - Do not include hidden files.
    Enum: 0, 1

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "get_file_information"

  - `module` (string)
    The name of the module called.
    Example: "Fileman"

  - `result` (object)

  - `result.data` (object)

  - `result.data.absdir` (string)
    The path to the user's home directory.
    Example: "/home/user"

  - `result.data.ctime` (integer)
    The file's creation time, Unix time format.
    Example: 1400573272

  - `result.data.exists` (integer)
    Whether the file exists in the directory.
* 1 - Exists.
* 0 - Does not exist.
    Enum: 0, 1

  - `result.data.file` (string)
    The filename.
    Example: "cgi-bin"

  - `result.data.fullpath` (string)
    The file's full filepath.
    Example: "/home/user/public_html/cgi-bin"

  - `result.data.gid` (integer)
    The file owner's system group ID.
    Example: 503

  - `result.data.humansize` (string)
    The file's formatted size, followed by one of the following symbols:
* KB - kilobytes
* MB - megabytes
* GB - gigabytes
    Example: "5 KB"

  - `result.data.isleaf` (integer)
    Whether the directory contains subdirectories.
* 1 - Contains subdirectories.
* 0 - Does not contain subdirectories.
    Enum: 0, 1

  - `result.data.mimename` (string)
    The file's MIME name.
    Example: "publichtml"

  - `result.data.mimetype` (string)
    The file's MIME type.
    Example: "text/plain"

  - `result.data.mode` (string)
    The file's textual permissions in [Unix format](https://en.wikipedia.org/wiki/File-system_permissions#Notation_of_traditional_Unix_permissions).
    Example: "16872"

  - `result.data.mtime` (integer)
    The file's last modification time, in Unix time format.
    Example: 1400573272

  - `result.data.nicemode` (integer)
    The file's numerical permissions in [octal notation](https://en.wikipedia.org/wiki/File-system_permissions#Notation_of_traditional_Unix_permissions).
    Example: 755

  - `result.data.path` (string)
    The file's path.
    Example: "/home/user/public.html"

  - `result.data.rawmimename` (string)
    The file's raw MIME name.
    Example: "text/plain"

  - `result.data.rawmimetype` (string)
    The file's raw MIME type.
    Example: "text/plain"

  - `result.data.read` (integer)
    Whether the file is readable. The function only returns this value if you set the include_permissions value to 1.
* 1 - Readable.
* 0 - Not readable.
    Enum: 0, 1

  - `result.data.size` (integer)
    The file's size, in bytes.
    Example: 4096

  - `result.data.type` (string)
    The item's type.
* file - File.
* dir - Directory.
* char - Character special device.
* block - Block special device.
* fifo - Named pipe.
* link - Symbolic link.
* socket - Unix domain socket.
    Enum: "file", "dir", "char", "block", "fifo", "link", "socket"

  - `result.data.uid` (integer)
    The file owner's system user ID.
    Example: 502

  - `result.data.write` (integer)
    Whether the file is writable. The function only returns this value if you set the include_permissions value to 1 .
* 1 - Writable.
* 0 - Not writable.
    Enum: 0, 1

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.status` (integer)
    * 1 - Success.
* 0 - Failed. Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


