Skip to content

Archive

Create and extract ZIP, TAR, and gzip archives.

6 modules

ModuleDescription
Giải nén GunzipGiải nén một tệp nén gzip
Nén GzipNén một tệp bằng gzip
Tạo Tệp TARTạo một tệp TAR với nén gzip/bz2/xz tùy chọn
Giải nén TARGiải nén tệp từ lưu trữ TAR (tự động phát hiện nén)
Tạo Tệp ZIPTạo một tệp ZIP từ danh sách các tệp
Giải nén Tệp ZIPGiải nén các tệp từ tệp ZIP

Modules

Giải nén Gunzip

archive.gunzip

Giải nén một tệp nén gzip

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-Đường dẫn đến tệp nén gzip
output_pathstringNo-Đường dẫn cho tệp đã giải nén (mặc định là đầu vào không có đuôi .gz)

Output:

FieldTypeDescription
pathstringĐường dẫn đến tệp đã giải nén
sizenumberKích thước tệp đã giải nén tính bằng byte

Example: Decompress a gzip file

yaml
input_path: /tmp/data.txt.gz

Nén Gzip

archive.gzip

Nén một tệp bằng gzip

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-Đường dẫn đến tệp cần nén
output_pathstringNo-Đường dẫn cho tệp đã nén (mặc định là input_path + .gz)

Output:

FieldTypeDescription
pathstringĐường dẫn đến tệp đã nén
original_sizenumberKích thước tệp gốc tính bằng byte
compressed_sizenumberKích thước tệp đã nén tính bằng byte
rationumberTỷ lệ nén (nén/gốc)

Example: Compress a file with gzip

yaml
input_path: /tmp/data.txt

Tạo Tệp TAR

archive.tar_create

Tạo một tệp TAR với nén gzip/bz2/xz tùy chọn

Parameters:

NameTypeRequiredDefaultDescription
output_pathstringYes-Đường dẫn cho tệp TAR đầu ra
filesarrayYes-Danh sách đường dẫn tệp để đưa vào tệp nén
compressionselect (none, gzip, bz2, xz)NogzipPhương pháp nén

Output:

FieldTypeDescription
pathstringĐường dẫn đến tệp TAR đã tạo
sizenumberKích thước lưu trữ tính bằng byte
file_countnumberSố lượng tệp trong lưu trữ

Example: Create gzipped TAR archive

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

Giải nén TAR

archive.tar_extract

Giải nén tệp từ lưu trữ TAR (tự động phát hiện nén)

Parameters:

NameTypeRequiredDefaultDescription
archive_pathstringYes-Đường dẫn đến lưu trữ TAR để giải nén
output_dirstringYes-Thư mục để giải nén tệp vào

Output:

FieldTypeDescription
extracted_filesarrayDanh sách đường dẫn tệp đã giải nén
total_sizenumberTổng kích thước tệp đã giải nén tính bằng byte

Example: Extract TAR.GZ archive

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

Tạo Tệp ZIP

archive.zip_create

Tạo một tệp ZIP từ danh sách các tệp

Parameters:

NameTypeRequiredDefaultDescription
output_pathstringYes-Đường dẫn cho tệp ZIP đầu ra
filesarrayYes-Danh sách đường dẫn tệp để đưa vào tệp nén
compressionselect (stored, deflated, bzip2, lzma)NodeflatedPhương pháp nén
passwordstringNo-Mật khẩu tùy chọn để bảo vệ tệp nén (chỉ hỗ trợ giải nén, hỗ trợ hạn chế)

Output:

FieldTypeDescription
pathstringĐường dẫn đến tệp ZIP đã tạo
sizenumberKích thước tệp nén tính bằng byte
file_countnumberSố lượng tệp trong tệp nén

Example: Create ZIP from files

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

Giải nén Tệp ZIP

archive.zip_extract

Giải nén các tệp từ tệp ZIP

Parameters:

NameTypeRequiredDefaultDescription
archive_pathstringYes-Đường dẫn đến tệp ZIP cần giải nén
output_dirstringYes-Thư mục để giải nén các tệp
passwordstringNo-Mật khẩu cho các tệp nén được mã hóa

Output:

FieldTypeDescription
extracted_filesarrayDanh sách đường dẫn tệp đã giải nén
total_sizenumberTổng kích thước của các tệp đã giải nén tính bằng byte

Example: Extract ZIP archive

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

Released under the Apache 2.0 License.