document mode argument for fs.symlink
This commit is contained in:
parent
666aa0a343
commit
d6bae2cb95
@ -170,12 +170,14 @@ the completion callback.
|
|||||||
|
|
||||||
Synchronous link(2).
|
Synchronous link(2).
|
||||||
|
|
||||||
### fs.symlink(linkdata, path, [callback])
|
### fs.symlink(linkdata, path, [type], [callback])
|
||||||
|
|
||||||
Asynchronous symlink(2). No arguments other than a possible exception are given
|
Asynchronous symlink(2). No arguments other than a possible exception are given
|
||||||
to the completion callback.
|
to the completion callback.
|
||||||
|
`type` argument can be either `'dir'` or `'file'` (default is `'file'`). It is only
|
||||||
|
used on Windows (ignored on other platforms).
|
||||||
|
|
||||||
### fs.symlinkSync(linkdata, path)
|
### fs.symlinkSync(linkdata, path, [type])
|
||||||
|
|
||||||
Synchronous symlink(2).
|
Synchronous symlink(2).
|
||||||
|
|
||||||
|
10
lib/fs.js
10
lib/fs.js
@ -422,17 +422,17 @@ fs.readlinkSync = function(path) {
|
|||||||
return binding.readlink(pathModule._makeLong(path));
|
return binding.readlink(pathModule._makeLong(path));
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.symlink = function(destination, path, mode_, callback) {
|
fs.symlink = function(destination, path, type_, callback) {
|
||||||
var mode = (typeof(mode_) == 'string' ? mode_ : null);
|
var type = (typeof(type_) == 'string' ? type_ : null);
|
||||||
var callback_ = arguments[arguments.length - 1];
|
var callback_ = arguments[arguments.length - 1];
|
||||||
callback = (typeof(callback_) == 'function' ? callback_ : null);
|
callback = (typeof(callback_) == 'function' ? callback_ : null);
|
||||||
binding.symlink(pathModule._makeLong(destination),
|
binding.symlink(pathModule._makeLong(destination),
|
||||||
pathModule._makeLong(path), mode, callback);
|
pathModule._makeLong(path), type, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.symlinkSync = function(destination, path, mode) {
|
fs.symlinkSync = function(destination, path, type) {
|
||||||
return binding.symlink(pathModule._makeLong(destination),
|
return binding.symlink(pathModule._makeLong(destination),
|
||||||
pathModule._makeLong(path), mode);
|
pathModule._makeLong(path), type);
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.link = function(srcpath, dstpath, callback) {
|
fs.link = function(srcpath, dstpath, callback) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user