$95 GRAYBYTE WORDPRESS FILE MANAGER $51

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/lib/node_modules/npm/node_modules/tar/lib/

HOME
Current File : /lib/node_modules/npm/node_modules/tar/lib//read-entry.js
'use strict'
const types = require('./types.js')
const MiniPass = require('minipass')

const SLURP = Symbol('slurp')
module.exports = class ReadEntry extends MiniPass {
  constructor (header, ex, gex) {
    super()
    // read entries always start life paused.  this is to avoid the
    // situation where Minipass's auto-ending empty streams results
    // in an entry ending before we're ready for it.
    this.pause()
    this.extended = ex
    this.globalExtended = gex
    this.header = header
    this.startBlockSize = 512 * Math.ceil(header.size / 512)
    this.blockRemain = this.startBlockSize
    this.remain = header.size
    this.type = header.type
    this.meta = false
    this.ignore = false
    switch (this.type) {
      case 'File':
      case 'OldFile':
      case 'Link':
      case 'SymbolicLink':
      case 'CharacterDevice':
      case 'BlockDevice':
      case 'Directory':
      case 'FIFO':
      case 'ContiguousFile':
      case 'GNUDumpDir':
        break

      case 'NextFileHasLongLinkpath':
      case 'NextFileHasLongPath':
      case 'OldGnuLongPath':
      case 'GlobalExtendedHeader':
      case 'ExtendedHeader':
      case 'OldExtendedHeader':
        this.meta = true
        break

      // NOTE: gnutar and bsdtar treat unrecognized types as 'File'
      // it may be worth doing the same, but with a warning.
      default:
        this.ignore = true
    }

    this.path = header.path
    this.mode = header.mode
    if (this.mode)
      this.mode = this.mode & 0o7777
    this.uid = header.uid
    this.gid = header.gid
    this.uname = header.uname
    this.gname = header.gname
    this.size = header.size
    this.mtime = header.mtime
    this.atime = header.atime
    this.ctime = header.ctime
    this.linkpath = header.linkpath
    this.uname = header.uname
    this.gname = header.gname

    if (ex) this[SLURP](ex)
    if (gex) this[SLURP](gex, true)
  }

  write (data) {
    const writeLen = data.length
    if (writeLen > this.blockRemain)
      throw new Error('writing more to entry than is appropriate')

    const r = this.remain
    const br = this.blockRemain
    this.remain = Math.max(0, r - writeLen)
    this.blockRemain = Math.max(0, br - writeLen)
    if (this.ignore)
      return true

    if (r >= writeLen)
      return super.write(data)

    // r < writeLen
    return super.write(data.slice(0, r))
  }

  [SLURP] (ex, global) {
    for (let k in ex) {
      // we slurp in everything except for the path attribute in
      // a global extended header, because that's weird.
      if (ex[k] !== null && ex[k] !== undefined &&
          !(global && k === 'path'))
        this[k] = ex[k]
    }
  }
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
1 Jan 1970 8.00 AM
root / root
0
buffer.js
0.276 KB
10 Mar 2021 9.36 PM
root / root
0644
create.js
2.318 KB
10 Mar 2021 9.36 PM
root / root
0644
extract.js
2.758 KB
10 Mar 2021 9.36 PM
root / root
0644
header.js
8.832 KB
10 Mar 2021 9.36 PM
root / root
0644
high-level-opt.js
0.754 KB
10 Mar 2021 9.36 PM
root / root
0644
large-numbers.js
2.158 KB
10 Mar 2021 9.36 PM
root / root
0644
list.js
3.078 KB
10 Mar 2021 9.36 PM
root / root
0644
mkdir.js
5.057 KB
10 Mar 2021 9.36 PM
root / root
0644
mode-fix.js
0.271 KB
10 Mar 2021 9.36 PM
root / root
0644
pack.js
9.389 KB
10 Mar 2021 9.36 PM
root / root
0644
parse.js
11.855 KB
10 Mar 2021 9.36 PM
root / root
0644
pax.js
3.975 KB
10 Mar 2021 9.36 PM
root / root
0644
read-entry.js
2.61 KB
10 Mar 2021 9.36 PM
root / root
0644
replace.js
5.363 KB
10 Mar 2021 9.36 PM
root / root
0644
types.js
1.069 KB
10 Mar 2021 9.36 PM
root / root
0644
unpack.js
16.461 KB
10 Mar 2021 9.36 PM
root / root
0644
update.js
0.832 KB
10 Mar 2021 9.36 PM
root / root
0644
warn-mixin.js
0.302 KB
10 Mar 2021 9.36 PM
root / root
0644
winchars.js
0.521 KB
10 Mar 2021 9.36 PM
root / root
0644
write-entry.js
11.771 KB
10 Mar 2021 9.36 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF