|
@ -4,6 +4,7 @@ var events = require('events'); |
|
|
var binding = process.binding('fs'); |
|
|
var binding = process.binding('fs'); |
|
|
var constants = process.binding('constants'); |
|
|
var constants = process.binding('constants'); |
|
|
var fs = exports; |
|
|
var fs = exports; |
|
|
|
|
|
var Stream = require('stream').Stream; |
|
|
|
|
|
|
|
|
var kMinPoolSpace = 128; |
|
|
var kMinPoolSpace = 128; |
|
|
var kPoolSize = 40 * 1024; |
|
|
var kPoolSize = 40 * 1024; |
|
@ -606,7 +607,7 @@ fs.createReadStream = function(path, options) { |
|
|
var ReadStream = fs.ReadStream = function(path, options) { |
|
|
var ReadStream = fs.ReadStream = function(path, options) { |
|
|
if (!(this instanceof ReadStream)) return new ReadStream(path, options); |
|
|
if (!(this instanceof ReadStream)) return new ReadStream(path, options); |
|
|
|
|
|
|
|
|
events.EventEmitter.call(this); |
|
|
Stream.call(this); |
|
|
|
|
|
|
|
|
var self = this; |
|
|
var self = this; |
|
|
|
|
|
|
|
@ -657,7 +658,7 @@ var ReadStream = fs.ReadStream = function(path, options) { |
|
|
self._read(); |
|
|
self._read(); |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
util.inherits(ReadStream, events.EventEmitter); |
|
|
util.inherits(ReadStream, Stream); |
|
|
|
|
|
|
|
|
fs.FileReadStream = fs.ReadStream; // support the legacy name
|
|
|
fs.FileReadStream = fs.ReadStream; // support the legacy name
|
|
|
|
|
|
|
|
@ -797,7 +798,7 @@ fs.createWriteStream = function(path, options) { |
|
|
var WriteStream = fs.WriteStream = function(path, options) { |
|
|
var WriteStream = fs.WriteStream = function(path, options) { |
|
|
if (!(this instanceof WriteStream)) return new WriteStream(path, options); |
|
|
if (!(this instanceof WriteStream)) return new WriteStream(path, options); |
|
|
|
|
|
|
|
|
events.EventEmitter.call(this); |
|
|
Stream.call(this); |
|
|
|
|
|
|
|
|
this.path = path; |
|
|
this.path = path; |
|
|
this.fd = null; |
|
|
this.fd = null; |
|
@ -824,7 +825,7 @@ var WriteStream = fs.WriteStream = function(path, options) { |
|
|
this.flush(); |
|
|
this.flush(); |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
util.inherits(WriteStream, events.EventEmitter); |
|
|
util.inherits(WriteStream, Stream); |
|
|
|
|
|
|
|
|
fs.FileWriteStream = fs.WriteStream; // support the legacy name
|
|
|
fs.FileWriteStream = fs.WriteStream; // support the legacy name
|
|
|
|
|
|
|
|
|