Skip to content

doc: clarify fs.copyFile() symlink behavior#61669

Open
junnyontop-pixel wants to merge 1 commit intonodejs:mainfrom
junnyontop-pixel:doc-copyfile-symlink
Open

doc: clarify fs.copyFile() symlink behavior#61669
junnyontop-pixel wants to merge 1 commit intonodejs:mainfrom
junnyontop-pixel:doc-copyfile-symlink

Conversation

@junnyontop-pixel
Copy link
Contributor

This PR documents that fs.copyFile() always dereferences symbolic links, as requested in #61518.

When src is a symbolic link, the contents of the target file are copied instead of the link itself.

Fixes: #61518

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Feb 4, 2026
@junnyontop-pixel
Copy link
Contributor Author

Sorry, I accidentally included a README change from my main branch. I will fix this PR to only include fs.md changes.

@Renegade334
Copy link
Member

Please can you squash your commits, so that doc: clarify fs.copyFile() symlink behavior is the commit message that appears in the final changelog.

@junnyontop-pixel
Copy link
Contributor Author

I've squashed the commits into one and fixed the trailing whitespace issue. The commit message has also been updated as you requested. Thanks!

@junnyontop-pixel
Copy link
Contributor Author

Hi @Renegade334, I've completed all the requested changes. Could you please take another look when you have a moment? Thanks!

@junnyontop-pixel
Copy link
Contributor Author

Sorry, I closed and reopened this PR by mistake.

Copy link
Member

@Renegade334 Renegade334 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just needs a quick layout edit.

Comment on lines +2444 to +2446
Note: `fs.copyFile()` always dereferences symbolic links.
If `src` is a symbolic link, the contents of the target file will be copied rather than the link itself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move this to the main description body? It shouldn't be above the section header. In between the first and second paragraphs seems like a sensible place.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document that fs.copyFile() dereferences symlinks

3 participants