|
|
@ -814,7 +814,7 @@ var WriteStream = fs.WriteStream = function(path, options) { |
|
|
|
|
|
|
|
this.path = path; |
|
|
|
this.fd = null; |
|
|
|
this.writeable = true; |
|
|
|
this.writable = true; |
|
|
|
|
|
|
|
this.flags = 'w'; |
|
|
|
this.encoding = 'binary'; |
|
|
@ -863,7 +863,7 @@ WriteStream.prototype.flush = function () { |
|
|
|
self.busy = false; |
|
|
|
|
|
|
|
if (err) { |
|
|
|
self.writeable = false; |
|
|
|
self.writable = false; |
|
|
|
if (cb) { |
|
|
|
cb(err); |
|
|
|
} |
|
|
@ -902,8 +902,8 @@ WriteStream.prototype.flush = function () { |
|
|
|
|
|
|
|
|
|
|
|
WriteStream.prototype.write = function (data) { |
|
|
|
if (!this.writeable) { |
|
|
|
throw new Error('stream not writeable'); |
|
|
|
if (!this.writable) { |
|
|
|
throw new Error('stream not writable'); |
|
|
|
} |
|
|
|
|
|
|
|
this.drainable = true; |
|
|
@ -940,7 +940,7 @@ WriteStream.prototype.close = function (cb) { |
|
|
|
|
|
|
|
|
|
|
|
WriteStream.prototype.end = function (cb) { |
|
|
|
this.writeable = false; |
|
|
|
this.writable = false; |
|
|
|
this._queue.push([fs.close, cb]); |
|
|
|
this.flush(); |
|
|
|
}; |
|
|
@ -959,7 +959,7 @@ WriteStream.prototype.forceClose = function (cb) { |
|
|
|
|
|
|
|
WriteStream.prototype.destroy = function (cb) { |
|
|
|
var self = this; |
|
|
|
this.writeable = false; |
|
|
|
this.writable = false; |
|
|
|
|
|
|
|
function close() { |
|
|
|
fs.close(self.fd, function(err) { |
|
|
|