tar
    Preparing search index...

    Class UnpackBase<E, O>

    The parts of the extraction that do not use the file system: the options, the checks of each entry, and the warnings. Unpack and UnpackSync add the file system work.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    chmod: boolean
    cwd: string

    The absolute path of the extraction directory.

    dirname: (path: string) => string

    The parent directory of an absolute path.

    dmode: number
    fatal?: { error: unknown }

    Set when an error stops the extraction.

    fmode: number
    forceChown: boolean
    gid?: number
    keep: boolean
    maxDepth: number
    newer: boolean
    noMtime: boolean
    opt: O

    The options, with no prototype.

    preserveOwner: boolean
    preservePaths: boolean
    processGid?: number
    processUid?: number
    processUmask: number
    resolve: (base: string, path: string) => string

    Resolve a path from an absolute path.

    strip: number
    uid?: number
    umask: number
    unlink: boolean
    win32: boolean
    writeFlag: (size: number) => string | number

    Gives the open flag for a new file of a given size.

    Methods

    • Check the entry, with no use of the file system. Set its absolute path, and change its path, linkpath, and mode to the values to extract. False if the entry must not be extracted.

      Parameters

      • entry: E

      Returns boolean

    • Report the failure of one entry as a TAR_ENTRY_ERROR warning. Throws the error if it stops the extraction: the extraction directory is not usable, the archive cannot be read, or strict is set.

      Parameters

      • er: unknown
      • entry: E

      Returns void

    • Record the error that stops the extraction. Returns it.

      Parameters

      • error: unknown

      Returns unknown

    • True if the entry can be written into the file that is on disk. A file with more than one link is not used, because the write would change the other links. Windows does not report a useful link count.

      Parameters

      Returns boolean

    • The parts of the path from the extraction directory to the target of a link entry. None of them can be a symbolic link.

      Parameters

      • entry: E
      • absolute: string

      Returns string[]

    • The owner to set on the entry, if it needs one: with preserveOwner, when the owner in the archive is not the process owner, and with uid and gid, when they are not the process owner.

      Parameters

      • entry: E

      Returns { gid: number; uid: number } | undefined

    • The parts of the path from the extraction directory to the parent directory of an entry. The extraction checks them again after it makes the entry: none of them can be a symbolic link then. So a directory that another process replaced with a symbolic link during the extraction is an error of the entry.

      Parameters

      • absolute: string

      Returns string[]

    • The paths that the entry must have for itself while it is made. A link also reserves its target, so that an entry that makes the target, and an entry that goes through the link, do not run at the same time as the link.

      Parameters

      • entry: E

      Returns string[]

    • The error for a link target that goes through a symbolic link.

      Parameters

      • symlink: string
      • parts: string[]

      Returns SymlinkError

    • The times to set on the entry, if it needs them.

      Parameters

      • entry: E

      Returns { atime: Date; mtime: Date } | undefined

    • Report a problem to onwarn, or throw it if strict is set. A damaged archive is always an error here, because the extraction cannot be complete.

      Parameters

      • code: string
      • message: string | Error
      • data: WarnData = {}

      Returns void