Skip to content

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

Closed
@OLEREO

Description

@OLEREO

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.fsIssues and PRs related to the fs subsystem / file system.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions