mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Modify fs.open to use accept a callback without a mode
This commit is contained in:
committed by
Ryan Dahl
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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user