|
@ -4,7 +4,7 @@ node.fs.exists = function (path, callback) { |
|
|
p.addErrback(function () { callback(false); }); |
|
|
p.addErrback(function () { callback(false); }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
node.fs.cat = function (path, encoding, callback) { |
|
|
node.fs.cat = function (path, encoding) { |
|
|
var open_promise = node.fs.open(path, node.O_RDONLY, 0666); |
|
|
var open_promise = node.fs.open(path, node.O_RDONLY, 0666); |
|
|
var cat_promise = new node.Promise(); |
|
|
var cat_promise = new node.Promise(); |
|
|
|
|
|
|
|
@ -12,7 +12,7 @@ node.fs.cat = function (path, encoding, callback) { |
|
|
|
|
|
|
|
|
open_promise.addErrback(function () { cat_promise.emitError(); }); |
|
|
open_promise.addErrback(function () { cat_promise.emitError(); }); |
|
|
open_promise.addCallback(function (fd) { |
|
|
open_promise.addCallback(function (fd) { |
|
|
var content = (encoding == node.UTF8 ? "" : []); |
|
|
var content = (encoding === node.UTF8 ? "" : []); |
|
|
var pos = 0; |
|
|
var pos = 0; |
|
|
|
|
|
|
|
|
function readChunk () { |
|
|
function readChunk () { |
|
|