PHP 8.2.30
Preview: socket-reader.js Size: 915 B
//proc/self/root/opt/alt/alt-nodejs11/root/lib/node_modules/npm/node_modules.bundled/fstream/lib/socket-reader.js

// Just get the stats, and then don't do anything.
// You can't really "read" from a socket.  You "connect" to it.
// Mostly, this is here so that reading a dir with a socket in it
// doesn't blow up.

module.exports = SocketReader

var inherits = require('inherits')
var Reader = require('./reader.js')

inherits(SocketReader, Reader)

function SocketReader (props) {
  var self = this
  if (!(self instanceof SocketReader)) {
    throw new Error('SocketReader must be called as constructor.')
  }

  if (!(props.type === 'Socket' && props.Socket)) {
    throw new Error('Non-socket type ' + props.type)
  }

  Reader.call(self, props)
}

SocketReader.prototype._read = function () {
  var self = this
  if (self._paused) return
  // basically just a no-op, since we got all the info we have
  // from the _stat method
  if (!self._ended) {
    self.emit('end')
    self.emit('close')
    self._ended = true
  }
}

Directory Contents

Dirs: 0 × Files: 14

Name Size Perms Modified Actions
1.98 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
1.75 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
6.35 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
4.40 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
3.89 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
2.53 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
610 B lrw-r--r-- 2021-10-19 09:47:47
Edit Download
1.47 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
2.78 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
1.96 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
2.39 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
6.92 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download
915 B lrw-r--r-- 2021-10-19 09:47:47
Edit Download
10.74 KB lrw-r--r-- 2021-10-19 09:47:47
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).