Browse Source

Modify fs.open to use accept a callback without a mode

v0.7.4-release
Russell Haering 15 years ago
committed by Ryan Dahl
parent
commit
6078c37be5
  1. 7
      lib/fs.js

7
lib/fs.js

@ -140,8 +140,11 @@ fs.closeSync = function (fd) {
return binding.close(fd); return binding.close(fd);
}; };
fs.open = function (path, flags, mode, callback) { fs.open = function (path, flags, mode_, callback) {
if (mode === undefined) { mode = 0666; } var mode = (typeof(mode_) == 'number' ? mode_ : 0666);
var callback_ = arguments[arguments.length - 1];
var callback = (typeof(callback_) == 'function' ? callback_ : null);
binding.open(path, stringToFlags(flags), mode, callback || noop); binding.open(path, stringToFlags(flags), mode, callback || noop);
}; };

Loading…
Cancel
Save