Skip to content

Commit 0460b18

Browse files
doc: clarify fs.copyFile() symlink behavior
This PR documents that `fs.copyFile()` always dereferences symbolic links, as requested in nodejs#61518. Fixes: nodejs#61518
1 parent 9aaf278 commit 0460b18

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎doc/api/fs.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,13 @@ See the POSIX close(2) documentation for more detail.
24412441
24422442
### `fs.copyFile(src, dest[, mode], callback)`
24432443
2444+
Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
2445+
already exists.
2446+
2447+
**Note:** `fs.copyFile()` always dereferences symbolic links. If `src` is a
2448+
symbolic link, the contents of the target file will be copied rather than the
2449+
link itself.
2450+
24442451
<!-- YAML
24452452
added: v8.5.0
24462453
changes:

0 commit comments

Comments
 (0)