projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
748469c
)
Modify fs.open to use accept a callback without a mode
author
Russell Haering
<russellhaering@gmail.com>
Mon, 23 Aug 2010 06:55:22 +0000
(23:55 -0700)
committer
Ryan Dahl
<ry@tinyclouds.org>
Mon, 23 Aug 2010 09:42:25 +0000
(
02:42
-0700)
lib/fs.js
patch
|
blob
|
history
diff --git
a/lib/fs.js
b/lib/fs.js
index
a644985
..
1e081c8
100644
(file)
--- a/
lib/fs.js
+++ b/
lib/fs.js
@@
-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);
};