Browse Source

Give default encodings for posix.read and posix.write

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
71680f512c
  1. 4
      src/node.js

4
src/node.js

@ -536,21 +536,25 @@ var posixModule = createInternalModule("posix", function (exports) {
exports.read = function (fd, length, position, encoding) {
var promise = new process.Promise()
encoding = encoding || "binary";
process.fs.read(fd, length, position, encoding, callback(promise));
return promise;
};
exports.readSync = function (fd, length, position, encoding) {
encoding = encoding || "binary";
return process.fs.read(fd, length, position, encoding);
};
exports.write = function (fd, data, position, encoding) {
var promise = new process.Promise()
encoding = encoding || "binary";
process.fs.write(fd, data, position, encoding, callback(promise));
return promise;
};
exports.writeSync = function (fd, data, position, encoding) {
encoding = encoding || "binary";
return process.fs.write(fd, data, position, encoding);
};

Loading…
Cancel
Save