From 35a4e2191d73d1d7ef9f7a872c811b48fc6315ff Mon Sep 17 00:00:00 2001 From: T Date: Fri, 24 Apr 2026 19:32:51 -0400 Subject: [PATCH] doc: clarify copyFile symlink behavior --- doc/api/fs.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index b2231bd20cc420..9ef0db5b9bdd1a 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1268,6 +1268,10 @@ changes: Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists. +Symbolic links are followed. If `src` is a symbolic link, the target file is +copied. If `dest` is a symbolic link, the target file is overwritten unless +`mode` contains `fs.constants.COPYFILE_EXCL`. + No guarantees are made about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, an attempt will be made to remove the destination. @@ -2747,6 +2751,10 @@ callback function. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination. +Symbolic links are followed. If `src` is a symbolic link, the target file is +copied. If `dest` is a symbolic link, the target file is overwritten unless +`mode` contains `fs.constants.COPYFILE_EXCL`. + `mode` is an optional integer that specifies the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. @@ -5838,6 +5846,10 @@ already exists. Returns `undefined`. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination. +Symbolic links are followed. If `src` is a symbolic link, the target file is +copied. If `dest` is a symbolic link, the target file is overwritten unless +`mode` contains `fs.constants.COPYFILE_EXCL`. + `mode` is an optional integer that specifies the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g.