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

# zipCompress

> ファイルまたはフォルダをZIP、TAR、JAR、またはGZIP アーカイブに圧縮します。

export const siteNameShort = "Arc";

ファイルまたはフォルダをアーカイブに圧縮します。個々のファイルを圧縮するには、`includefile#` を使用します。フォルダを圧縮するには、`includefolder#` を使用します。

## 必要なパラメータ

* **type**：アーカイブの種類。使用できる値はZIP、TAR、JAR、およびGZIP です。デフォルトはZIP です。
* **archive**：オペレーションがアーカイブを配置するディスク上のパス（ファイル名を含む）。
* **includefile#**：アーカイブに含めるファイルの配列。例えば、2つのファイルをアーカイブするには、それらのファイルへのファイルパスを`includefile#1` および `includefile#2` に設定します。{siteNameShort}Script の配列属性の詳細については、[ArcScript 入門](./operations)を参照してください。
* **includefolder#**：アーカイブに含めるフォルダの配列。例えば、2つのフォルダをアーカイブするには、それらのフォルダへのファイルパスを`includefolder#1` および `includefolder#2` に設定します。

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

* **manifest**：マニフェストファイルの場所。JAR アーカイブに対してのみ有効です。

## アウトプット属性

* **zip:result**：オペレーションが成功した場合、SUCCESS が返されます。

## 例

この例では、2つのフォルダ（`/tmp/foo` および `/tmp/bar`）を圧縮し、`/home/mydata.gzip` にあるgzip アーカイブに配置します。

```xml theme={null}
<!-- Creating the input item and the necessary attributes -->
<arc:set attr="zip.archive" value="/home/mydata.gzip" />
<arc:set attr="zip.type" value="GZIP" />
<arc:set attr="zip.includefolder#1" value="/tmp/foo" />
<arc:set attr="zip.includefolder#2" value="/tmp/bar" />

<arc:call op="zipCompress" in="zip">
  <!-- Optional logging step to log the status of the operation to the application log. -->
  <arc:set attr="_log.info" value="The zipCompress operation for connector [ConnectorId] has finished with a status of [results.zip:result]." />
</arc:call>
```
