Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs.symlink "type=junction" Create file soft link error #40184

Closed
OLEREO opened this issue Sep 23, 2021 · 1 comment · Fixed by #47907
Closed

fs.symlink "type=junction" Create file soft link error #40184

OLEREO opened this issue Sep 23, 2021 · 1 comment · Fixed by #47907
Labels
doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform.

Comments

@OLEREO
Copy link

OLEREO commented Sep 23, 2021

Version

v14.17.5

Platform

Win32NT 10.0.19043.0 Microsoft Windows NT 10.0.19043.0 x64

Subsystem

FS

What steps will reproduce the bug?

If you use fs.symlink under windows, if you don't use UAC, you will get an "operation not permitted" error.
But adding "type=junction" option can eliminate UAC, but only folders can correctly create soft links. The file will also be recognized as a folder, and the created soft link cannot be used.

fs.symlink('C:\\Users\\olereo\\Desktop\\me\\excel_file.xlsx','C:\\Users\\olereo\\Desktop\\me\\excel_file_sl.xlsx','junction',err=>console.log(err))
fs.symlink('C:\\Users\\olereo\\Desktop\\me\\text_file.txt','C:\\Users\\olereo\\Desktop\\me\\text_file_sl.txt','junction',err=>console.log(err))
fs.symlink('C:\\Users\\olereo\\Desktop\\me\\Folders','C:\\Users\\olereo\\Desktop\\me\\Folders_sl','junction',err=>console.log(err))

sc

How often does it reproduce? Is there a required condition?

always

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

@Ayase-252 Ayase-252 added fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform. labels Sep 23, 2021
@bzoz
Copy link
Contributor

bzoz commented Oct 19, 2021

NTFS junction points can only point to folders. This is not a bug in Node.js, just a limitation of the OS. I think it should be documented, both in Node and in libuv.

@targos targos added the doc Issues and PRs related to the documentations. label Oct 19, 2021
bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue May 7, 2023
nodejs-github-bot pushed a commit that referenced this issue May 9, 2023
Fixes: #40184
PR-URL: #47907
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Debadree Chatterjee <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
targos pushed a commit that referenced this issue May 12, 2023
Fixes: #40184
PR-URL: #47907
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Debadree Chatterjee <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
danielleadams pushed a commit that referenced this issue Jul 6, 2023
Fixes: #40184
PR-URL: #47907
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Debadree Chatterjee <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
MoLow pushed a commit to MoLow/node that referenced this issue Jul 6, 2023
Fixes: nodejs#40184
PR-URL: nodejs#47907
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Debadree Chatterjee <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants