|
|
@ -655,8 +655,7 @@ FileWriteStream.prototype.flush = function () { |
|
|
|
|
|
|
|
this.busy = true; |
|
|
|
|
|
|
|
var |
|
|
|
method = args.shift(), |
|
|
|
var method = args.shift(), |
|
|
|
cb = args.pop(); |
|
|
|
|
|
|
|
var self = this; |
|
|
@ -703,12 +702,14 @@ FileWriteStream.prototype.flush = function () { |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
FileWriteStream.prototype.write = function(data, cb) { |
|
|
|
FileWriteStream.prototype.write = function(data, encoding) { |
|
|
|
if (!this.writeable) { |
|
|
|
throw new Error('stream not writeable'); |
|
|
|
} |
|
|
|
|
|
|
|
this._queue.push([fs.write, data, undefined, this.encoding, cb]); |
|
|
|
// TODO handle Buffer
|
|
|
|
|
|
|
|
this._queue.push([fs.write, data, undefined, encoding || 'utf8', null]); |
|
|
|
this.flush(); |
|
|
|
|
|
|
|
return false; |
|
|
|