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

fs: fs.cp() should try copy-on-write if the platform supports it #47074

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
@@ -226,7 +229,7 @@ function mayCopyFile(srcStat, src, dest, opts) {
}

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