fs: fs.cp() should try copy-on-write if the platform supports it by tetsuharuohzeki · Pull Request #47074 · nodejs/node
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.
|
|
||
| function copyFile(srcStat, src, dest, opts) { | ||
| copyFileSync(src, dest); | ||
| copyFileSync(src, dest, COPYFILE_FICLONE); |
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.
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!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters