Skip to content

Commit 6f9b9df

Browse files
cookesanaduh95
authored andcommitted
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 2480acb commit 6f9b9df

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
@@ -1327,6 +1327,10 @@ changes:
13271327
Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
13281328
already exists.
13291329
1330+
Symbolic links are followed. If `src` is a symbolic link, the target file is
1331+
copied. If `dest` is a symbolic link, the target file is overwritten unless
1332+
`mode` contains `fs.constants.COPYFILE_EXCL`.
1333+
13301334
No guarantees are made about the atomicity of the copy operation. If an
13311335
error occurs after the destination file has been opened for writing, an attempt
13321336
will be made to remove the destination.
@@ -2838,6 +2842,10 @@ callback function. Node.js makes no guarantees about the atomicity of the copy
28382842
operation. If an error occurs after the destination file has been opened for
28392843
writing, Node.js will attempt to remove the destination.
28402844
2845+
Symbolic links are followed. If `src` is a symbolic link, the target file is
2846+
copied. If `dest` is a symbolic link, the target file is overwritten unless
2847+
`mode` contains `fs.constants.COPYFILE_EXCL`.
2848+
28412849
`mode` is an optional integer that specifies the behavior
28422850
of the copy operation. It is possible to create a mask consisting of the bitwise
28432851
OR of two or more values (e.g.
@@ -5992,6 +6000,10 @@ already exists. Returns `undefined`. Node.js makes no guarantees about the
59926000
atomicity of the copy operation. If an error occurs after the destination file
59936001
has been opened for writing, Node.js will attempt to remove the destination.
59946002
6003+
Symbolic links are followed. If `src` is a symbolic link, the target file is
6004+
copied. If `dest` is a symbolic link, the target file is overwritten unless
6005+
`mode` contains `fs.constants.COPYFILE_EXCL`.
6006+
59956007
`mode` is an optional integer that specifies the behavior
59966008
of the copy operation. It is possible to create a mask consisting of the bitwise
59976009
OR of two or more values (e.g.

0 commit comments

Comments
 (0)