Files
node/doc/api
Tetsuharu Ohzeki a54e898dc8 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>
2023-05-02 09:34:00 +02:00
..
2023-03-03 23:46:12 +00:00
2023-04-17 16:48:24 -03:00
2023-05-02 09:33:58 +02:00
2023-03-26 18:03:58 +00:00
2023-01-14 14:25:08 +00:00
2023-04-13 16:48:54 -03:00
2022-06-30 09:34:10 -04:00
2023-04-17 16:48:24 -03:00
2022-12-24 21:04:19 +01:00
2023-04-13 16:48:54 -03:00
2023-03-14 19:52:10 +01:00
2022-11-01 04:21:13 +00:00
2023-04-17 16:48:24 -03:00