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

copySync('my_symlink') always dereferences the symlink #447

Closed
maikokuppe opened this issue Jun 22, 2017 · 2 comments
Closed

copySync('my_symlink') always dereferences the symlink #447

maikokuppe opened this issue Jun 22, 2017 · 2 comments

Comments

@maikokuppe
Copy link

Given this folder structure

file.txt
my_symlink -> file.txt

running one of these commands

fs.copySync('my_symlink', 'my_symlink_copy')
fs.copySync('my_symlink', 'my_symlink_copy', { dereference: false })
fs.copySync('my_symlink', 'my_symlink_copy', { dereference: true })

yields

file.txt
my_symlink -> file.txt
my_symlink_copy // this is a hardlink

This workaround works though:

fs.copySync('my_symlink', 'my_symlink_copy', { recursive: true })
@manidlou
Copy link
Collaborator

@maikokuppe recursive option has never been documented. In fact, I brought it up in #424. When recursive option is removed from the copySync() source code, your first command will most likely return the expected result.

@manidlou
Copy link
Collaborator

Fixed in 5.0.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants