Class FileEntry

Refered to as a "central directory" record in the spec. This is a file metadata entry inside the "central directory".

Constructors

Properties

_data: ArrayBufferLike
attributeCompat: AttributeCompat

The upper byte of "version made by", indicates the compatibility of the file attribute information.

comment: string

The comment for this file

commentLength: number

The length of the comment

compressedSize: number

The size of the file compressed

compressionMethod: CompressionMethod
crc32: number
datetime: number
externalAttributes: number

The mapping of the external attributes is host-system dependent. For MS-DOS, the low order byte is the MS-DOS directory attribute byte. If input came from standard input, this field is set to zero.

extraLength: number

The length of the extra field

flag: number

General purpose bit flags

headerRelativeOffset: number

This is the offset from the start of the first disk on which this file appears to where the local header should be found.

internalAttributes: number
name: string

The name of the file, with optional relative path. The filename is preloaded here, since looking it up is expensive.

4.4.17.1 claims:

  • All slashes are forward ('/') slashes.
  • Filename doesn't begin with a slash.
  • No drive letters
  • If filename is missing, the input came from standard input.

Unfortunately, this isn't true in practice. Some Windows zip utilities use a backslash here, but the correct Unix-style path in file headers. To avoid seeking all over the file to recover the known-good filenames from file headers, we simply convert '/' to '' here.

nameLength: number

The length of the file name

signature: number
startDisk: number

The number of the disk on which this file begins.

uncompressedSize: number

The size of the file uncompressed

versionNeeded: number

The minimum supported ZIP specification version needed to extract the file.

zipData: ArrayBufferLike
zipVersion: number

The lower byte of "version made by", indicates the ZIP specification version supported by the software used to encode the file. major — floor zipVersion / 10 minor — zipVersion mod 10

Accessors

  • get isDirectory(): boolean
  • Whether this entry is a directory

    Returns boolean

  • get isFile(): boolean
  • Whether this entry is a file

    Returns boolean

  • get size(): number
  • The total size of the this entry

    Returns number