Skip to content

Archive

Create and extract ZIP, TAR, and gzip archives.

6 modules

ModuleDescription
คลายบีบอัด Gunzipคลายบีบอัดไฟล์ที่บีบอัดด้วย gzip
บีบอัด Gzipบีบอัดไฟล์เดี่ยวด้วย gzip
สร้างไฟล์ TARสร้างไฟล์ TAR พร้อมการบีบอัด gzip/bz2/xz
แยกไฟล์ TARแยกไฟล์จากไฟล์ TAR (ตรวจจับการบีบอัดอัตโนมัติ)
สร้างไฟล์ ZIPสร้างไฟล์ ZIP จากรายการไฟล์
แยกไฟล์ ZIPแยกไฟล์จากไฟล์ ZIP

Modules

คลายบีบอัด Gunzip

archive.gunzip

คลายบีบอัดไฟล์ที่บีบอัดด้วย gzip

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-เส้นทางไปยังไฟล์ที่บีบอัดด้วย gzip
output_pathstringNo-เส้นทางสำหรับไฟล์ที่คลายบีบอัดแล้ว (ค่าเริ่มต้นคือ input โดยไม่มีนามสกุล .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-เส้นทางสำหรับไฟล์ที่บีบอัดแล้ว (ค่าเริ่มต้นคือ input_path + .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

สร้างไฟล์ TAR พร้อมการบีบอัด gzip/bz2/xz

Parameters:

NameTypeRequiredDefaultDescription
output_pathstringYes-เส้นทางสำหรับไฟล์ TAR ที่สร้าง
filesarrayYes-รายการเส้นทางไฟล์ที่จะรวมในไฟล์ TAR
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-รายการเส้นทางไฟล์ที่จะรวมในไฟล์ ZIP
compressionselect (stored, deflated, bzip2, lzma)Nodeflatedวิธีการบีบอัด
passwordstringNo-รหัสผ่านเพื่อป้องกันไฟล์ ZIP (เฉพาะการคลายบีบอัด, รองรับจำกัด)

Output:

FieldTypeDescription
pathstringเส้นทางไปยังไฟล์ ZIP ที่สร้าง
sizenumberขนาดไฟล์ ZIP เป็นไบต์
file_countnumberจำนวนไฟล์ในไฟล์ ZIP

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-รหัสผ่านสำหรับไฟล์ ZIP ที่เข้ารหัส

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.