Skip to content

Commit fc3c5ab

Browse files
doc: clarify fs.copyFile() symlink behavior
1 parent 1818bb7 commit fc3c5ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/api/fs.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,6 +2467,9 @@ callback function. Node.js makes no guarantees about the atomicity of the copy
24672467
operation. If an error occurs after the destination file has been opened for
24682468
writing, Node.js will attempt to remove the destination.
24692469
2470+
Note: `fs.copyFile()` always dereferences symbolic links.
2471+
If `src` is a symbolic link, the contents of the target file will be copied rather than the link itself.
2472+
24702473
`mode` is an optional integer that specifies the behavior
24712474
of the copy operation. It is possible to create a mask consisting of the bitwise
24722475
OR of two or more values (e.g.

0 commit comments

Comments
 (0)