-
Notifications
You must be signed in to change notification settings - Fork 1
ZipArchiveEntry Class
This class like C# ZipArchiveEntry
Represents a compressed file within a zip archive.
Type: CentralDirectory
CentralDirectory of this entry.
Type: LocalFileHeader
LocalFileHeader of this entry.
Type: ZipArchive
Gets the zip archive that the entry belongs to.
Type: Number
Gets the compressed size of the entry in the zip archive.
Type: Number
The 32-bit Cyclic Redundant Check.
Type: Number
OS and application specific file attributes.
Type: String
Gets the relative path of the entry in the zip archive.
Type: Date
Gets or sets the last time the entry in the zip archive was changed.
Type: Number
Gets the uncompressed size of the entry in the zip archive.
Type: String
Gets the file name of the entry in the zip archive.
Read & Initial LocalFileHeader structure of this entry.
Source: libzip.ts:127
| Type | Name | Description | Necessary |
|---|
Deletes the entry from the zip archive.
Source: libzip.ts:132
| Type | Name | Description | Necessary |
|---|
import { ZipFile, ZipArchive, ZIpArchiveEntry } from 'libzip';
const archive: ZipArchive = ZipFile.Open('zip file.zip');
const entry: ZipArchiveEntry = archive.GetEntry('entry name');
entry.Delete();
archive.Save();Read the entry from the zip archive.
Source: libzip.ts:141
| Type | Name | Description | Necessary |
|---|
import { ZipFile, ZipArchive, ZIpArchiveEntry } from 'libzip';
import fs from 'fs';
const archive: ZipArchive = ZipFile.Open('zip file.zip');
const entry: ZipArchiveEntry = archive.GetEntry('entry name');
const buf: Buffer = entry.Read();
fs.writeFileSync('file name', buf);Read the entry from the zip archive.
Source: libzip.ts:148
| Type | Name | Description | Necessary |
|---|
import { ZipFile, ZipArchive, ZIpArchiveEntry } from 'libzip';
import fs from 'fs';
const archive: ZipArchive = ZipFile.Open('zip file.zip');
const entry: ZipArchiveEntry = archive.CreateEntry('new entry name');
const buf: Buffer = fs.readFileSync('file');
entry.Write(buf);Extract the file in the specified zip archive to a file on the file system.
Source: libzip.ts:168
| Type | Name | Description | Necessary |
|---|---|---|---|
| String | dir | Extract target directory | FALSE |
import { ZipFile, ZipArchive, ZipArchiveEntry } from 'libzip';
const archive: ZipArchive = ZipFile.Open('zip file.zip');
const entry: ZipArchiveEntry = archive.GetEntry('entry name');
entry.ExtractEntry(); // __dirname directory
/* do something */