@@ -1175,8 +1175,18 @@ operation. If an error occurs after the destination file has been opened for
11751175writing, Node.js will attempt to remove the destination.
11761176
11771177` flags ` is an optional integer that specifies the behavior
1178- of the copy operation. The only supported flag is ` fs.constants.COPYFILE_EXCL ` ,
1179- which causes the copy operation to fail if ` dest ` already exists.
1178+ of the copy operation. It is possible to create a mask consisting of the bitwise
1179+ OR of two or more values (e.g.
1180+ ` fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE ` ).
1181+
1182+ * ` fs.constants.COPYFILE_EXCL ` - The copy operation will fail if ` dest ` already
1183+ exists.
1184+ * ` fs.constants.COPYFILE_FICLONE ` - The copy operation will attempt to create a
1185+ copy-on-write reflink. If the platform does not support copy-on-write, then a
1186+ fallback copy mechanism is used.
1187+ * ` fs.constants.COPYFILE_FICLONE_FORCE ` - The copy operation will attempt to
1188+ create a copy-on-write reflink. If the platform does not support copy-on-write,
1189+ then the operation will fail.
11801190
11811191Example:
11821192
@@ -1216,8 +1226,18 @@ atomicity of the copy operation. If an error occurs after the destination file
12161226has been opened for writing, Node.js will attempt to remove the destination.
12171227
12181228` flags ` is an optional integer that specifies the behavior
1219- of the copy operation. The only supported flag is ` fs.constants.COPYFILE_EXCL ` ,
1220- which causes the copy operation to fail if ` dest ` already exists.
1229+ of the copy operation. It is possible to create a mask consisting of the bitwise
1230+ OR of two or more values (e.g.
1231+ ` fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE ` ).
1232+
1233+ * ` fs.constants.COPYFILE_EXCL ` - The copy operation will fail if ` dest ` already
1234+ exists.
1235+ * ` fs.constants.COPYFILE_FICLONE ` - The copy operation will attempt to create a
1236+ copy-on-write reflink. If the platform does not support copy-on-write, then a
1237+ fallback copy mechanism is used.
1238+ * ` fs.constants.COPYFILE_FICLONE_FORCE ` - The copy operation will attempt to
1239+ create a copy-on-write reflink. If the platform does not support copy-on-write,
1240+ then the operation will fail.
12211241
12221242Example:
12231243
@@ -3814,8 +3834,18 @@ error occurs after the destination file has been opened for writing, Node.js
38143834will attempt to remove the destination.
38153835
38163836` flags ` is an optional integer that specifies the behavior
3817- of the copy operation. The only supported flag is ` fs.constants.COPYFILE_EXCL ` ,
3818- which causes the copy operation to fail if ` dest ` already exists.
3837+ of the copy operation. It is possible to create a mask consisting of the bitwise
3838+ OR of two or more values (e.g.
3839+ ` fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE ` ).
3840+
3841+ * ` fs.constants.COPYFILE_EXCL ` - The copy operation will fail if ` dest ` already
3842+ exists.
3843+ * ` fs.constants.COPYFILE_FICLONE ` - The copy operation will attempt to create a
3844+ copy-on-write reflink. If the platform does not support copy-on-write, then a
3845+ fallback copy mechanism is used.
3846+ * ` fs.constants.COPYFILE_FICLONE_FORCE ` - The copy operation will attempt to
3847+ create a copy-on-write reflink. If the platform does not support copy-on-write,
3848+ then the operation will fail.
38193849
38203850Example:
38213851
@@ -4449,6 +4479,34 @@ The following constants are meant for use with [`fs.access()`][].
44494479 </tr >
44504480</table >
44514481
4482+ ### File Copy Constants
4483+
4484+ The following constants are meant for use with [ ` fs.copyFile() ` ] [ ] .
4485+
4486+ <table >
4487+ <tr >
4488+ <th>Constant</th>
4489+ <th>Description</th>
4490+ </tr >
4491+ <tr >
4492+ <td><code>COPYFILE_EXCL</code></td>
4493+ <td>If present, the copy operation will fail with an error if the
4494+ destination path already exists.</td>
4495+ </tr >
4496+ <tr >
4497+ <td><code>COPYFILE_FICLONE</code></td>
4498+ <td>If present, the copy operation will attempt to create a
4499+ copy-on-write reflink. If the underlying platform does not support
4500+ copy-on-write, then a fallback copy mechanism is used.</td>
4501+ </tr >
4502+ <tr >
4503+ <td><code>COPYFILE_FICLONE_FORCE</code></td>
4504+ <td>If present, the copy operation will attempt to create a
4505+ copy-on-write reflink. If the underlying platform does not support
4506+ copy-on-write, then the operation will fail with an error.</td>
4507+ </tr >
4508+ </table >
4509+
44524510### File Open Constants
44534511
44544512The following constants are meant for use with ` fs.open() ` .
0 commit comments