Lines Matching refs:stream
39 const { Readable, Writable, finished } = require('stream');
48 const stream = this;
49 if (typeof stream.fd === 'number') {
54 if (stream.open !== openWriteFs && stream.open !== openReadFs) {
56 const orgEmit = stream.emit;
57 stream.emit = function(...args) {
69 stream.open();
71 stream[kFs].open(stream.path, stream.flags, stream.mode, (er, fd) => {
75 stream.fd = fd;
77 stream.emit('open', stream.fd);
78 stream.emit('ready');
113 function close(stream, err, cb) {
114 if (!stream.fd) {
117 stream[kFs].close(stream.fd, (er) => {
120 stream.fd = null;
124 function importFd(stream, options) {
130 stream[kFs] = options.fs || fs;
139 stream[kHandle] = options.fd;
140 stream[kFs] = FileHandleOperations(stream[kHandle]);
141 stream[kHandle][kRef]();
142 options.fd.on('close', FunctionPrototypeBind(stream.close, stream));