| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 634c5f1 commit 4c8800c
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -664,16 +664,22 @@ information. | |||
| 664 | 664 | ||
| 665 | 665 | Synchronous stat(2). Returns an instance of [`fs.Stats`][]. | |
| 666 | 666 | ||
| 667 | - ## fs.symlink(destination, path[, type], callback) | ||
| 667 | + ## fs.symlink(target, path[, type], callback) | ||
| 668 | 668 | ||
| 669 | 669 | Asynchronous symlink(2). No arguments other than a possible exception are given | |
| 670 | 670 | to the completion callback. | |
| 671 | 671 | The `type` argument can be set to `'dir'`, `'file'`, or `'junction'` (default | |
| 672 | 672 | is `'file'`) and is only available on Windows (ignored on other platforms). | |
| 673 | 673 | Note that Windows junction points require the destination path to be absolute. When using | |
| 674 | - `'junction'`, the `destination` argument will automatically be normalized to absolute path. | ||
| 674 | + `'junction'`, the `target` argument will automatically be normalized to absolute path. | ||
| 675 | 675 | ||
| 676 | - ## fs.symlinkSync(destination, path[, type]) | ||
| 676 | + Here is an example below: | ||
| 677 | + | ||
| 678 | + fs.symlink('./foo', './new-port'); | ||
| 679 | + | ||
| 680 | + It would create a symlic link named with "new-port" that points to "foo". | ||
| 681 | + | ||
| 682 | + ## fs.symlinkSync(target, path[, type]) | ||
| 677 | 683 | ||
| 678 | 684 | Synchronous symlink(2). Returns `undefined`. | |
| 679 | 685 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -920,29 +920,29 @@ function preprocessSymlinkDestination(path, type, linkPath) { | |||
| 920 | 920 | } | |
| 921 | 921 | } | |
| 922 | 922 | ||
| 923 | - fs.symlink = function(destination, path, type_, callback_) { | ||
| 923 | + fs.symlink = function(target, path, type_, callback_) { | ||
| 924 | 924 | var type = (typeof type_ === 'string' ? type_ : null); | |
| 925 | 925 | var callback = makeCallback(arguments[arguments.length - 1]); | |
| 926 | 926 | ||
| 927 | - if (!nullCheck(destination, callback)) return; | ||
| 927 | + if (!nullCheck(target, callback)) return; | ||
| 928 | 928 | if (!nullCheck(path, callback)) return; | |
| 929 | 929 | ||
| 930 | 930 | var req = new FSReqWrap(); | |
| 931 | 931 | req.oncomplete = callback; | |
| 932 | 932 | ||
| 933 | - binding.symlink(preprocessSymlinkDestination(destination, type, path), | ||
| 933 | + binding.symlink(preprocessSymlinkDestination(target, type, path), | ||
| 934 | 934 | pathModule._makeLong(path), | |
| 935 | 935 | type, | |
| 936 | 936 | req); | |
| 937 | 937 | }; | |
| 938 | 938 | ||
| 939 | - fs.symlinkSync = function(destination, path, type) { | ||
| 939 | + fs.symlinkSync = function(target, path, type) { | ||
| 940 | 940 | type = (typeof type === 'string' ? type : null); | |
| 941 | 941 | ||
| 942 | - nullCheck(destination); | ||
| 942 | + nullCheck(target); | ||
| 943 | 943 | nullCheck(path); | |
| 944 | 944 | ||
| 945 | - return binding.symlink(preprocessSymlinkDestination(destination, type, path), | ||
| 945 | + return binding.symlink(preprocessSymlinkDestination(target, type, path), | ||
| 946 | 946 | pathModule._makeLong(path), | |
| 947 | 947 | type); | |
| 948 | 948 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -580,15 +580,15 @@ static void Symlink(const FunctionCallbackInfo<Value>& args) { | |||
| 580 | 580 | ||
| 581 | 581 | int len = args.Length(); | |
| 582 | 582 | if (len < 1) | |
| 583 | - return TYPE_ERROR("dest path required"); | ||
| 583 | + return TYPE_ERROR("target path required"); | ||
| 584 | 584 | if (len < 2) | |
| 585 | 585 | return TYPE_ERROR("src path required"); | |
| 586 | 586 | if (!args[0]->IsString()) | |
| 587 | - return TYPE_ERROR("dest path must be a string"); | ||
| 587 | + return TYPE_ERROR("target path must be a string"); | ||
| 588 | 588 | if (!args[1]->IsString()) | |
| 589 | 589 | return TYPE_ERROR("src path must be a string"); | |
| 590 | 590 | ||
| 591 | - node::Utf8Value dest(env->isolate(), args[0]); | ||
| 591 | + node::Utf8Value target(env->isolate(), args[0]); | ||
| 592 | 592 | node::Utf8Value path(env->isolate(), args[1]); | |
| 593 | 593 | int flags = 0; | |
| 594 | 594 | ||
@@ -604,9 +604,9 @@ static void Symlink(const FunctionCallbackInfo<Value>& args) { | |||
| 604 | 604 | } | |
| 605 | 605 | ||
| 606 | 606 | if (args[3]->IsObject()) { | |
| 607 | - ASYNC_DEST_CALL(symlink, args[3], *path, *dest, *path, flags) | ||
| 607 | + ASYNC_DEST_CALL(symlink, args[3], *path, *target, *path, flags) | ||
| 608 | 608 | } else { | |
| 609 | - SYNC_DEST_CALL(symlink, *dest, *path, *dest, *path, flags) | ||
| 609 | + SYNC_DEST_CALL(symlink, *target, *path, *target, *path, flags) | ||
| 610 | 610 | } | |
| 611 | 611 | } | |
| 612 | 612 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments