diff options
author | Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> | 2023-04-20 15:28:18 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-20 06:28:18 +0000 |
commit | 12094bcb97819b2eef1000dd5cb793d6b064680d (patch) | |
tree | 6504d6177105dd10a99b593204cfcdd2110427ff /Makefile | |
parent | b68cedd4d85157914944b1672310c6023dc8635d (diff) | |
download | node-new-12094bcb97819b2eef1000dd5cb793d6b064680d.tar.gz |
fs: add support for mode flag to specify the copy behavior
`fs.copyFile()` supports copy-on-write operation
if the underlying platform supports it by passing a mode flag.
This behavior was added in
https://github.com/nodejs/node/commit/a16d88d9e9a6581e463082549823189aba25ca76.
This patch adds `mode` flag to `fs.cp()`, `fs.cpSync()`,
and `fsPromises.cp()` to allow to change their behaviors
to copy files.
This test case is based on the test case that was introduced
when we add `fs.constants.COPYFILE_FICLONE`.
https://github.com/nodejs/node/commit/a16d88d9e9a6581e463082549823189aba25ca76.
This test strategy is:
- If the platform supports copy-on-write operation,
check whether the destination is expected
- Otherwise, the operation will fail
and check whether the failure error information is expected.
Fixes: https://github.com/nodejs/node/issues/47080
PR-URL: https://github.com/nodejs/node/pull/47084
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions