Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed0b62c

Browse filesBrowse files
tetsuharuohzekiMoLow
authored andcommitted
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 a16d88d. 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`. a16d88d. 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: #47080 PR-URL: #47084 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent d9448b8 commit ed0b62c
Copy full SHA for ed0b62c

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎doc/api/fs.md‎

Copy file name to clipboardExpand all lines: doc/api/fs.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -5158,7 +5158,7 @@ changes:
51585158
pr-url: https://github.com/nodejs/node/pull/47084
51595159
description: Accept an additional `mode` option to specify
51605160
the copy behavior as the `mode` argument of `fs.copyFile()`.
5161-
- version: v17.6.0
5161+
- version: v17.6.0
51625162
pr-url: https://github.com/nodejs/node/pull/41819
51635163
description: Accepts an additional `verbatimSymlinks` option to specify
51645164
whether to perform path resolution for symlinks.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.