Skip to content

Commit 0d84f29

Browse files
authored
doc: clarify copyFile symlink behavior
Signed-off-by: T <cookesan@users.noreply.github.com> PR-URL: #62941 Fixes: #61518 Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent 16c06b8 commit 0d84f29

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

doc/api/fs.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,10 @@ changes:
13341334
Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
13351335
already exists.
13361336
1337+
Symbolic links are followed. If `src` is a symbolic link, the target file is
1338+
copied. If `dest` is a symbolic link, the target file is overwritten unless
1339+
`mode` contains `fs.constants.COPYFILE_EXCL`.
1340+
13371341
No guarantees are made about the atomicity of the copy operation. If an
13381342
error occurs after the destination file has been opened for writing, an attempt
13391343
will be made to remove the destination.
@@ -2852,6 +2856,10 @@ callback function. Node.js makes no guarantees about the atomicity of the copy
28522856
operation. If an error occurs after the destination file has been opened for
28532857
writing, Node.js will attempt to remove the destination.
28542858
2859+
Symbolic links are followed. If `src` is a symbolic link, the target file is
2860+
copied. If `dest` is a symbolic link, the target file is overwritten unless
2861+
`mode` contains `fs.constants.COPYFILE_EXCL`.
2862+
28552863
`mode` is an optional integer that specifies the behavior
28562864
of the copy operation. It is possible to create a mask consisting of the bitwise
28572865
OR of two or more values (e.g.
@@ -6021,6 +6029,10 @@ already exists. Returns `undefined`. Node.js makes no guarantees about the
60216029
atomicity of the copy operation. If an error occurs after the destination file
60226030
has been opened for writing, Node.js will attempt to remove the destination.
60236031
6032+
Symbolic links are followed. If `src` is a symbolic link, the target file is
6033+
copied. If `dest` is a symbolic link, the target file is overwritten unless
6034+
`mode` contains `fs.constants.COPYFILE_EXCL`.
6035+
60246036
`mode` is an optional integer that specifies the behavior
60256037
of the copy operation. It is possible to create a mask consisting of the bitwise
60266038
OR of two or more values (e.g.

0 commit comments

Comments
 (0)