Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
document mode argument for fs.symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Zinkovsky committed Dec 16, 2011
1 parent 666aa0a commit d6bae2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions doc/api/fs.markdown
Expand Up @@ -170,12 +170,14 @@ the completion callback.

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
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).

Expand Down
10 changes: 5 additions & 5 deletions lib/fs.js
Expand Up @@ -422,17 +422,17 @@ fs.readlinkSync = function(path) {
return binding.readlink(pathModule._makeLong(path));
};

fs.symlink = function(destination, path, mode_, callback) {
var mode = (typeof(mode_) == 'string' ? mode_ : null);
fs.symlink = function(destination, path, type_, callback) {
var type = (typeof(type_) == 'string' ? type_ : null);
var callback_ = arguments[arguments.length - 1];
callback = (typeof(callback_) == 'function' ? callback_ : null);
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),
pathModule._makeLong(path), mode);
pathModule._makeLong(path), type);
};

fs.link = function(srcpath, dstpath, callback) {
Expand Down

0 comments on commit d6bae2c

Please sign in to comment.