-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
cp
and cpSync
incorrectly handle existing dest symlinks
#58468
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
Labels
fs
Issues and PRs related to the fs subsystem / file system.
Comments
cp
and cpSync
incorrectly handle existing dest symlinks
cc. @nodejs/fs 🙂 |
nodejs-github-bot
pushed a commit
that referenced
this issue
Jun 7, 2025
PR-URL: #58476 Fixes: #58468 Reviewed-By: Dario Piotrowicz <[email protected]>
nodejs-github-bot
pushed a commit
that referenced
this issue
Jun 7, 2025
PR-URL: #58476 Fixes: #58468 Reviewed-By: Dario Piotrowicz <[email protected]>
targos
pushed a commit
that referenced
this issue
Jun 7, 2025
This reverts commit 52430b9. PR-URL: #58476 Fixes: #58468 Reviewed-By: Dario Piotrowicz <[email protected]>
targos
pushed a commit
that referenced
this issue
Jun 7, 2025
PR-URL: #58476 Fixes: #58468 Reviewed-By: Dario Piotrowicz <[email protected]>
targos
pushed a commit
that referenced
this issue
Jun 7, 2025
PR-URL: #58476 Fixes: #58468 Reviewed-By: Dario Piotrowicz <[email protected]>
seriousme
pushed a commit
to seriousme/node
that referenced
this issue
Jun 10, 2025
This reverts commit 52430b9. PR-URL: nodejs#58476 Fixes: nodejs#58468 Reviewed-By: Dario Piotrowicz <[email protected]>
seriousme
pushed a commit
to seriousme/node
that referenced
this issue
Jun 10, 2025
PR-URL: nodejs#58476 Fixes: nodejs#58468 Reviewed-By: Dario Piotrowicz <[email protected]>
seriousme
pushed a commit
to seriousme/node
that referenced
this issue
Jun 10, 2025
PR-URL: nodejs#58476 Fixes: nodejs#58468 Reviewed-By: Dario Piotrowicz <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Version
v24.1.0
Platform
Subsystem
fs
What steps will reproduce the bug?
Run the following code:
How often does it reproduce? Is there a required condition?
the issue can always be reproduced and it does not require a specific condition
What is the expected behavior? Why is that the expected behavior?
I believe that the second
cpSync
call should not throw any error, but the existing symlink files should be skipped unlessforce
is set tofalse
anderrorOnExist
istrue
, in such case anEEXIST
error should be thrown insteadWhat do you see instead?
The second
cpSync
call throws anERR_FS_CP_EINVAL
errorAdditional information
The
ERR_FS_CP_EINVAL
error is thrown even whenforce
is being used (and the dest file is not overridden).This applies both to
cp
andcpSync
`cp` reproduction
dereference
totrue
seems to fix the issue, however I am not sure if dereferencing is actually taking place since the symlinks are copied as such and not as the files they point to (which I think is the expected behavior? 🤔)The text was updated successfully, but these errors were encountered: