> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prophecy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Directory gem for Data Analysis

> List files and folders of a specified directory

export const execution_engine_0 = "Prophecy Automate"

<Info>This gem runs in {execution_engine_0}.</Info>

## Overview

List files and folders of a specified directory from a data ingress/egress connection.

## Prerequisites

* Run Prophecy version 4.1.3 or higher.

## Input and Output

The Directory gem does not accept any inputs.

The Directory gem produces one output. The output schema includes the following columns:

* `name`: The name of the file.
* `path`: The full path to the file.
* `size_in_bytes`: The size of the file. Folders will be listed as `0` bytes.
* `creation_time`: The time that the file was created.
* `modification_time`: The time that the file was last modified.
* `parent_directory`: The parent directory of the file or folder.
* `file_type`: Whether the record listed is a file or a folder.
* `sheet_name`: The name of the excel sheet in an XLSX file. This column appears when the **Include sheet name as column in output for xlsx files** parameter is enabled.

If a certain connection does not provide a certain field (for example, Databricks does not provide creation time), then the columns will be populated with zeroes or null values.

## Parameters

Configure the Directory gem using the following parameters.

| Parameter                                             | Description                                                                                                                                                                                                                                                                               |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Connection type                                       | The data provider to connect to. See [Supported connection types](#supported-connection-types).                                                                                                                                                                                           |
| Select or create connection                           | New or existing connection to the provider you selected.                                                                                                                                                                                                                                  |
| Path                                                  | Path to directory that you want to see the contents of.                                                                                                                                                                                                                                   |
| Enable to include files/directories inside subfolders | When enabled, the gem recursively traverses and include all files and directories within subdirectories of the specified path.                                                                                                                                                            |
| File pattern (Optional)                               | Regular expression (regex) pattern used to narrow results to matching entries.                                                                                                                                                                                                            |
| Include sheet name as column in output for xlsx files | When enabled, the gem adds a column to the output that includes XLSX sheet names. If a file has multiple sheets, one row is generated per sheet name. For example, a file with three sheets produces three rows—one for each sheet. This field is `null` if the file is not an XLSX file. |

## Supported connection types

You can use the Directory gem to list files and folders from the following connection types:

* [Databricks Volumes](/data-analysis/environment/connections/databricks)
* [Amazon S3](/data-analysis/environment/connections/s3)
* [OneDrive](/data-analysis/environment/connections/onedrive)
* [SFTP](/data-analysis/environment/connections/sftp)
* [SharePoint](/data-analysis/environment/connections/sharepoint)
* [Smartsheet](/data-analysis/environment/connections/smartsheet)
