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

# fileListDir

> 指定されたパスにあるファイルおよびディレクトリをリストします。オプションで再帰的なリストや、マスクまたはエントリの種類によるフィルタリングが可能です。

指定されたパスにあるファイルおよびディレクトリをリストします。

## 必要なパラメータ

* **path**：ディレクトリおよびファイルがリストされる完全修飾パス（例：`/tmp/mydirectory`）。

## オプションのパラメータ

* **mask**：結果エントリのフィルタリングに使用するパターン。デフォルトは`*` です。例えば、`*.json` というマスクは、拡張子が`.json` のすべてのファイルに一致します。
* **recurse**：再帰的にエントリをリストするかどうか。`false` および`true` が使用可能です。デフォルト値は`false` です。
* **fileordir**：ファイルおよびディレクトリのみをリストするかどうか。`all`、`files`、および`dirs` が使用可能です。デフォルトは`all` です。

## アウトプット属性

* **file:fullname**：現在のエントリのファイルまたはディレクトリのフルパス。
* **file:name**：現在のエントリのファイルまたはディレクトリの名前。
* **file:mtime**：現在のエントリのファイルまたはディレクトリが書き込まれた時間。
* **file:ctime**：現在のエントリのファイルまたはディレクトリが作成された時間。
* **file:atime**：現在のエントリのファイルまたはディレクトリが読み出された、または書き込まれた時間。
* **file:attributes**：現在のエントリのファイルまたはディレクトリの属性のリスト。
* **file:extension**：現在のエントリのファイルの拡張子。
* **file:size**：ファイルのサイズ（バイト）。
* **file:isdir**：エントリがファイルかディレクトリか。

## 例

```xml theme={null}
<!-- Setting the path to monitor on the input item -->
<arc:set attr="input.path" value="/tmp/timesensitive" />
<!-- Enabling recursion to check all subdirectories within the input path -->
<arc:set attr="input.recurse" value="true" />
<!-- Checking for files only, across all directories found by the operation -->
<arc:set attr="input.fileordir" value="files" />
<!-- Calling the operation and passing in the input item and setting an output item -->
<arc:call op="fileListDir" in="input" out="result" >
  <!-- Executing an expression that checks each file creation date in each directory -->
  <arc:if exp="[result.file:ctime | dateadd('day', 1) | datediff | lessthan(0)]" >
    <!-- If it is older than 1 day, log an entry in the application log -->
    <!-- This can be expanded to add more logic such as sending an email using appSendEmail -->
    <arc:set attr="_log.info" value="The file [result.file:name] located at [result.file:fullname] has been idle within [input.path] for longer than 1 day." />
  </arc:if>
</arc:call>
```
