Skip to content

Archive

Create and extract ZIP, TAR, and gzip archives.

6 modules

ModuleDescription
Gunzip 解凍gzip 圧縮ファイルを解凍
Gzip 圧縮単一ファイルを gzip で圧縮
TAR アーカイブ作成オプションで gzip/bz2/xz 圧縮を使用して TAR アーカイブを作成
TARアーカイブを抽出TARアーカイブからファイルを抽出(圧縮を自動検出)
ZIP アーカイブ作成ファイルリストから ZIP アーカイブを作成
ZIP アーカイブ抽出ZIP アーカイブからファイルを抽出

Modules

Gunzip 解凍

archive.gunzip

gzip 圧縮ファイルを解凍

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-gzip 圧縮ファイルのパス
output_pathstringNo-解凍ファイルのパス(デフォルトは .gz 拡張子なしの入力)

Output:

FieldTypeDescription
pathstring解凍ファイルのパス
sizenumber解凍ファイルサイズ(バイト)

Example: Decompress a gzip file

yaml
input_path: /tmp/data.txt.gz

Gzip 圧縮

archive.gzip

単一ファイルを gzip で圧縮

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-圧縮するファイルのパス
output_pathstringNo-圧縮ファイルのパス(デフォルトは入力パス + .gz)

Output:

FieldTypeDescription
pathstring圧縮ファイルのパス
original_sizenumber元のファイルサイズ(バイト)
compressed_sizenumber圧縮ファイルサイズ(バイト)
rationumber圧縮率(圧縮後 / 元のサイズ)

Example: Compress a file with gzip

yaml
input_path: /tmp/data.txt

TAR アーカイブ作成

archive.tar_create

オプションで gzip/bz2/xz 圧縮を使用して TAR アーカイブを作成

Parameters:

NameTypeRequiredDefaultDescription
output_pathstringYes-出力 TAR ファイルのパス
filesarrayYes-アーカイブに含めるファイルパスのリスト
compressionselect (none, gzip, bz2, xz)Nogzip圧縮方法

Output:

FieldTypeDescription
pathstring作成された TAR ファイルのパス
sizenumberアーカイブのサイズ(バイト)
file_countnumberアーカイブ内のファイル数

Example: Create gzipped TAR archive

yaml
output_path: /tmp/archive.tar.gz
files: ["/tmp/file1.txt", "/tmp/file2.txt"]
compression: gzip

TARアーカイブを抽出

archive.tar_extract

TARアーカイブからファイルを抽出(圧縮を自動検出)

Parameters:

NameTypeRequiredDefaultDescription
archive_pathstringYes-抽出するTARアーカイブのパス
output_dirstringYes-ファイルを抽出するディレクトリ

Output:

FieldTypeDescription
extracted_filesarray抽出されたファイルパスのリスト
total_sizenumber抽出されたファイルの合計サイズ(バイト)

Example: Extract TAR.GZ archive

yaml
archive_path: /tmp/archive.tar.gz
output_dir: /tmp/extracted/

ZIP アーカイブ作成

archive.zip_create

ファイルリストから ZIP アーカイブを作成

Parameters:

NameTypeRequiredDefaultDescription
output_pathstringYes-出力 ZIP ファイルのパス
filesarrayYes-アーカイブに含めるファイルパスのリスト
compressionselect (stored, deflated, bzip2, lzma)Nodeflated圧縮方法
passwordstringNo-アーカイブを保護するためのオプションのパスワード(抽出のみ、サポートは限定的)

Output:

FieldTypeDescription
pathstring作成された ZIP ファイルのパス
sizenumberアーカイブサイズ(バイト)
file_countnumberアーカイブ内のファイル数

Example: Create ZIP from files

yaml
output_path: /tmp/archive.zip
files: ["/tmp/file1.txt", "/tmp/file2.txt"]
compression: deflated

ZIP アーカイブ抽出

archive.zip_extract

ZIP アーカイブからファイルを抽出

Parameters:

NameTypeRequiredDefaultDescription
archive_pathstringYes-抽出する ZIP アーカイブのパス
output_dirstringYes-ファイルを抽出するディレクトリ
passwordstringNo-暗号化アーカイブ用のパスワード

Output:

FieldTypeDescription
extracted_filesarray抽出されたファイルパスのリスト
total_sizenumber抽出されたファイルの合計サイズ(バイト)

Example: Extract ZIP archive

yaml
archive_path: /tmp/archive.zip
output_dir: /tmp/extracted/

Released under the Apache 2.0 License.