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

How to copy symlinks to target as normal folders #191

Closed
screendriver opened this issue Nov 3, 2015 · 6 comments
Closed

How to copy symlinks to target as normal folders #191

screendriver opened this issue Nov 3, 2015 · 6 comments
Milestone

Comments

@screendriver
Copy link

Can I set the -L option like in the unix command cp?

From the man page:

‘-L’ ,‘--dereference’ - Follow symbolic links when copying from them. With this option, cp
cannot create a symbolic link. For example, a symlink (to regular file) in the source tree will be
copied to a regular file in the destination tree.

See also here at superuser

@jprichardson jprichardson added this to the 1.0 milestone Nov 3, 2015
@jprichardson
Copy link
Owner

Try setting deference to true:

fs.copy(src, dest, { dereference: true }, callback)

Let me know if that works. I'm gonna leave this open, as that should be documented.

@screendriver
Copy link
Author

Thank you, it's working 👍

@jhnns
Copy link

jhnns commented Feb 17, 2016

Thx @jprichardson. Just being curious: why is this option not listed in the README?

@jprichardson
Copy link
Owner

@jhnns it's because it doesn't exist in copySync. It should be implemented in copySync as well.

@jhnns
Copy link

jhnns commented Feb 18, 2016

Sounds reasonable 👍

rjz added a commit to rjz/node-fs-extra that referenced this issue Apr 15, 2016
jprichardson added a commit that referenced this issue Apr 15, 2016
Adds symlink dereference option to `fse.copySync` (#191)
@jprichardson
Copy link
Owner

Implemented in #235

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

3 participants