| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
In man ln the arguments are called TARGET and LINK_NAME. Perhaps we should be consistent with that and pick target and linkName or just name instead ? |
Sorry, something went wrong.
|
man ln will be different across platforms though. On OS X, it is source_file and target_file (or target_dir) |
Sorry, something went wrong.
|
Ah, I didn't know it's consistent with man command. BTW, if as @evanlucas said, this behaviors are different across platforms, shouldn't the cross-platform Node.js unify it? (I'm using OSX). |
Sorry, something went wrong.
|
Oh, @targos @evanlucas Why do you reference the command ln, what I have changed on is symlink(2), am I right? After reading at the man symlink, which uses path1 and path2 as below:
Then now I'm able to understand why the author of this function used destination as the name of 1st one, because the context said there is a pointer to the file described by the 1st one, that we called it source at other function like fs.link. However, not all Node.js user is such that familiar with Linux like me, then the naming of arguments in fs.link and fs.symlink were really really confused. So I still proposal that keep consistent with fs.link's naming rule, any thoughts? |
Sorry, something went wrong.
|
Ahhh good point. I think that this is less confusing than the current documentation. LGTM |
Sorry, something went wrong.
There was a problem hiding this comment.
You also need to update mentions of "destination path" here.
Sorry, something went wrong.
|
Fair enough, I didn't get that the point was to make it consistent with fs.link, sorry ! |
Sorry, something went wrong.
|
Never mind @targos, fixed nits and updated the naming in source files, LGTY too? |
Sorry, something went wrong.
Sorry, something went wrong.
|
BTW, I found a typo of errors in fs.link and created a new PR at #3917 :-) |
Sorry, something went wrong.
|
@yorkie ... awesome. This LGTM but curious what @nodejs/ctc would think about the semver-iness of this change. It seems like a fairly significant mismatch between the docs, the API and the implementation in JS. Also, minor nit, can you please update the title of the PR to be doc,fs: to reflect that it's a change to both the doc and the fs module? |
Sorry, something went wrong.
|
I'm going to mark this semver-major for now as a precaution. |
Sorry, something went wrong.
|
Done :-) |
Sorry, something went wrong.
|
How is this going? is the CI happy now? This seems to be suspended over 4 days :-) |
Sorry, something went wrong.
|
Just to be clear, this change won't break any existing code or will it? |
Sorry, something went wrong.
|
The documentation change is incorrect. I reverted a similar change in in 5843ae8. |
Sorry, something went wrong.
|
Let me clarify a bit, too. symlinkSync(destination, path) creates a symbolic link at path which points at destination. If this patch gets landed, it becomes this: symlinkSync(srcpath, dstpath) creates a symbolic link at dstpath which points at srcpath. If the fs.link() documentation is unclear, I would prefer to see that fixed rather than applied to other documentation sections. |
Sorry, something went wrong.
|
Thanks @piscisaureus and now I have some explanations more about this question, the following is a description from man link/ln:
The above manual seems to use source to stand for the existing file, and the below is also from manual:
So I think the file pointed from the link should be unified by this manual.
@piscisaureus as you said, I correct your words as: creates a symbolic link/pointer to the source_file, and this link/pointer is named by target_file, so I'm proposing that Node.js should use target instead of dest in link, symlink. |
Sorry, something went wrong.
It's not that easy. In the Linux doc, target is used for the path that the symlink points at: http://man7.org/linux/man-pages/man2/symlink.2.html |
Sorry, something went wrong.
A symbolic link points to another path. There doesn't actually need to be a file there. I think "target" is an appropriate name for the path that the symbolic link points to. link() is different in the sense that it doesn't point at another path - it adds a new name for a file that already exists. It has more in common with rename(old_name, new_name) than it has with symlink - the difference being that link adds a name and rename changes the name. So I would suggest the link docs be made consistent with rename rather than symlink. You can see the linux man pages do the same thing:
versus |
Sorry, something went wrong.
|
@piscisaureus I do that agree with you 100%, and I now updated my commits to use target instead of destination. Could you take a look again, thank you guys :-) |
Sorry, something went wrong.
|
LGTM. Thanks for your patience @yorkie! |
Sorry, something went wrong.
|
LGTM if CI is happy. |
Sorry, something went wrong.
|
@yorkie CI doesn't seem to be happy with this change. https://ci.nodejs.org/job/node-test-commit-osx/1298/nodes=osx1010/console |
Sorry, something went wrong.
|
Sorry, I guess I have something forgot to update, I will check it again, sorry :-) |
Sorry, something went wrong.
|
That's right |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
Btw, if semver is right to marjor, when this would get this merged? Does this get documented? |
Sorry, something went wrong.
|
Thank you guys :-) |
Sorry, something went wrong.
|
Ping guys |
Sorry, something went wrong.
Sorry, something went wrong.
|
@Trott Why create a new CI? because I didn't push any changes to the last CI. |
Sorry, something went wrong.
|
Whoops, my mistake. |
Sorry, something went wrong.
|
@yorkie your last push was 10 days ago, it can be possible that new commits on master make the changes in this PR fail |
Sorry, something went wrong.
|
FWIW, the latest CI passed except for known-flaky tests on Windows (including one that would be fixed by #4062, hey someone go look at that and give it an LGTM if you're comfy with the change, will ya?). |
Sorry, something went wrong.
PR-URL: #3912 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
Landed in 8c35903 (The patch didn't apply cleanly on fs.markdown so check my work carefully on that one to make sure I didn't mess anything up.) |
Sorry, something went wrong.
|
@Trott I guess you missed to add @trevnorris to reviewers list at 8c35903 |
Sorry, something went wrong.
|
Never mind, that's my fault, thank you Trott :-) |
Sorry, something went wrong.
PR-URL: #3912 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #3912 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #3912 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#3912 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Bert Belder <bertbelder@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
| Back | FazBrowse Home | New Git URL |
So firstly, the destination has a little confusion like I got the log:
And my source call is:
Because I thought the first argument stands for destination as the original doc is telling, but it actually is source. Plus, I also make link* and symlinkSync be consistent :-)