mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 18:02:21 +00:00
Modify fs.open to use accept a callback without a mode
This commit is contained in:
parent
748469c71c
commit
6078c37be5
@ -140,8 +140,11 @@ fs.closeSync = function (fd) {
|
||||
return binding.close(fd);
|
||||
};
|
||||
|
||||
fs.open = function (path, flags, mode, callback) {
|
||||
if (mode === undefined) { mode = 0666; }
|
||||
fs.open = function (path, flags, mode_, callback) {
|
||||
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);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user