Skip to content

Conversation

@tetsuharuohzeki
Copy link
Contributor

fs.cp() and fs.cpSync() should use fs.constants.COPYFILE_FICLONE mode flag to try copy-on-write for copying a file if the platform supports its operation.

`fs.cp()` and `fs.cpSync()` should use
`fs.constants.COPYFILE_FICLONE` mode flag to try to use
copy-on-write for copying a file
if the platform supports its operation.
@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Mar 13, 2023

function copyFile(srcStat, src, dest, opts) {
copyFileSync(src, dest);
copyFileSync(src, dest, COPYFILE_FICLONE);
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like something that users should pass in via cp()'s options argument, and not something that Node core sets unconditionally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. I withdeaw this pr. Thank you for your review!

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

Labels

fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants