-
Notifications
You must be signed in to change notification settings - Fork 1
ZipArchive Class
개발자 윤군 edited this page Jan 15, 2021
·
4 revisions
This class like C# ZipArchive
Represents a package of compressed files in the zip archive format.
Type: ZipArchiveEntry Array
The collection of entries that are currently in the zip archive.
Type: String
The password of zip file for en/decryption.
Type: String
The filename (include directory) of zip file.
Type: Buffer
Zip file buffer.
Retrieves a wrapper for the specified entry in the zip archive.
Source: libzip.ts:326
| Type | Name | Description | Necessary |
|---|---|---|---|
| String | entryName | Entry name | TRUE |
import { ZipFile, ZipArchive, ZIpArchiveEntry } from 'libzip';
const archive: ZipArchive = ZipFile.Open('zip file.zip');
const entry: ZipArchiveEntry = archive.GetEntry('entry name');Creates an empty entry in the zip archive.
Source: libzip.ts:333
| Type | Name | Description | Necessary |
|---|---|---|---|
| String | entryName | Name of new entry | TRUE |
import { ZipFile, ZipArchive, ZIpArchiveEntry } from 'libzip';
const archive: ZipArchive = ZipFile.Open('zip file.zip');
const entry: ZipArchiveEntry = archive.CreateEntry('entry name');Extracts all the files in the specified zip archive to a directory on the file system.
Source: libzip.ts:360
| Type | Name | Description | Necessary |
|---|---|---|---|
| String | dir | Extract target directory | FALSE |
import { ZipFile, ZipArchive } from 'libzip';
const archive: ZipArchive = ZipFile.Open('zip file path.zip');
archive.ExtractAll('./dst path');
/* do something */Just save zip file.
Source: libzip.ts:381
| Type | Name | Description | Necessary |
|---|
import { ZipFile, ZipArchive } from 'libzip';
const archive: ZipArchive = ZipFile.Open('zip file path.zip');
// save as
archive.Filename = 'change name';
archive.save();
/* do something */