This repository was archived by the owner on Apr 22, 2023. It is now read-only.
Relative junction should behave like dangling symlink#8813
Closed
vweevers wants to merge 1 commit intonodejs:v0.10from
vweevers:win-relative-symlink
Closed
Relative junction should behave like dangling symlink#8813vweevers wants to merge 1 commit intonodejs:v0.10from vweevers:win-relative-symlink
vweevers wants to merge 1 commit intonodejs:v0.10from
vweevers:win-relative-symlink
Conversation
|
Completely right. I am suprised this didn't get caught earlier. |
piscisaureus
pushed a commit
to nodejs/node
that referenced
this pull request
Dec 9, 2014
PR-URL: nodejs/node-v0.x-archive#8813 Reviewed-By: Bert Belder <bertbelder@gmail.com>
|
And thanks :) |
vweevers
added a commit
to vweevers/rnpm
that referenced
this pull request
Dec 9, 2014
Fixes: - `cli-prompt` replaces deprecated `prompt` method of `commander` - Use absolute junctions for XP, pending nodejs/node-v0.x-archive#8813 New commands: - `rnpm prune [--production]` - `rnpm shrinkwrap` - `rnpm list --depth=n` New aliases and shorthands: - `i`: install - `ls`: list - `--prod`: --production
Member
|
@piscisaureus ... looks like this never landed... any further thoughts on it? |
|
@jasnell - it landed in io.js: nodejs/node@764c5c7 |
Member
|
@vweevers @piscisaureus ... I know it's been a while on this one, but after apply this fix to the current |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A junction path must be absolute, which is why fs.symlink resolves paths on Windows if the type is
junction. E.g.fs.symlink("../foo", "my/link", "junction"). From the docs:Sidenote: Reading that, you'd think the
dstpathargument is normalized. What the docs mean to say is that thesrcpath(the target) is normalized. The function signature in the source isfs.symlink(destination, path); these inconsistencies are confusing.However, the target seems to be normalized relative to the working directory - not relative to the link's parent directory like it should:
Of course, a junction is not the same as a symlink, but the behavior should be consistent, given that node on unix ignores the
junctionargument and will create a dangling symlink. It should do the same on Windows, or at least simulate it. This PR normalizes the target, relative to the link's parent directory. Meaning:fs.symlink("..\foo", "C:\my\link", "junction")becomes:
fs.symlink("C:\foo", "C:\my\link", "junction")The included test is copied from
test-fs-symlink-dir-junction.js. These tests could probably be merged, I didn't (yet) for the sake of clarity - and because the other (regular symlink) tests fail anyway on Windows XP.