> ## 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.

# zipScan

> 圧縮アーカイブをスキャンし、含まれるファイルとディレクトリに関するメタデータを返します。

圧縮アーカイブをスキャンして、含まれるファイルとディレクトリに関する情報を取得します。

## 必要なパラメータ

* **type**：アーカイブの種類。使用できる値はZIP、TAR、JAR、およびGZIP です。デフォルトはZIP です。
* **archive**：スキャンするアーカイブのディスク上のパス（ファイル名を含む）。

## アウトプット属性

* **zip:filename**：ファイルまたはディレクトリの名前（パスを含む）。
* **zip:compressedsize**：圧縮時のファイルのサイズ（バイト単位）。
* **zip:decompressedsize**：展開時のファイルのサイズ（バイト単位）。
* **zip:lastmodified**：ファイルまたはディレクトリが最後に変更された日時。

## 例

次の例では、既存のzip アーカイブをスキャンし、アーカイブ内の各ファイルとディレクトリに関する情報をアウトプットデータに継続的に追加します。すべてのファイルとディレクトリのスキャンが完了すると、データはアウトプットファイルとして送り出されます。

```xml theme={null}
<!-- Creating the input item and the necessary attributes -->
<arc:set attr="zip.archive" value="C:\\Temp\\test.zip" />
<arc:set attr="zip.type" value="ZIP" />
<!-- Initializing the output data -->
<arc:set attr="output.data" value="" />

<arc:call op="zipScan" in="zip" out="results">
  <!-- Appending the information of each file and folder to the output data -->
  <arc:set attr="output.data" value="[output.data]\nThe file [results.zip:filename] has a compressed size of [results.zip:compressedsize] bytes and an uncompressed size of [results.zip:decompressedsize] bytes. The last modified time is [results.zip:lastmodified]." />
</arc:call>

<!-- Pushing the output item out as a file -->
<arc:set attr="output.filename" value="result.txt" />
<arc:push item="output" />
```

アウトプットデータは次のようになります：

```
The file zipthis\ has a compressed size of 0 bytes and an uncompressed size of 0 bytes. The last modified time is 2023-01-31 10:29:18.
The file zipthis\movies.xml has a compressed size of 252 bytes and an uncompressed size of 782 bytes. The last modified time is 2022-11-15 13:14:36.
The file zipthis\rickybobby.xml has a compressed size of 74 bytes and an uncompressed size of 78 bytes. The last modified time is 2022-11-21 13:31:54.
The file zipthis\subaru.xml has a compressed size of 97 bytes and an uncompressed size of 172 bytes. The last modified time is 2022-10-31 15:11:06.
The file MyTest\ has a compressed size of 0 bytes and an uncompressed size of 0 bytes. The last modified time is 2023-08-29 16:40:06.
The file MyTest\file1.xml has a compressed size of 5348 bytes and an uncompressed size of 50304 bytes. The last modified time is 2023-08-29 16:40:06.
The file MyTest\file2.xml has a compressed size of 4135 bytes and an uncompressed size of 40953 bytes. The last modified time is 2023-08-29 16:40:06.
The file MyTest\file3.json has a compressed size of 5717 bytes and an uncompressed size of 46924 bytes. The last modified time is 2023-08-29 16:40:06.
The file MyTest\file4.json has a compressed size of 8320 bytes and an uncompressed size of 75023 bytes. The last modified time is 2023-08-29 16:40:06.
```
