From fc3c5ab5e41347adfb5d68dddfc1db677aa9c463 Mon Sep 17 00:00:00 2001 From: ayj8201 Date: Tue, 3 Feb 2026 21:53:18 +0900 Subject: [PATCH] doc: clarify fs.copyFile() symlink behavior --- doc/api/fs.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index 6ea9fa9fdde0f2..7bba5e887024d0 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2467,6 +2467,9 @@ 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. +Note: `fs.copyFile()` always dereferences symbolic links. +If `src` is a symbolic link, the contents of the target file will be copied rather than the link itself. + `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.