Skip to content

Commit 511d40c

Browse files
authored
doc,fs: update description of fs.stat() method
PR-URL: #47654 Fixes: #47633 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name>
1 parent 0c5f253 commit 511d40c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/api/fs.md

+3
Original file line numberDiff line numberDiff line change
@@ -4126,6 +4126,9 @@ Asynchronous stat(2). The callback gets two arguments `(err, stats)` where
41264126

41274127
In case of an error, the `err.code` will be one of [Common System Errors][].
41284128

4129+
[`fs.stat()`][] follows symbolic links. Use [`fs.lstat()`][] to look at the
4130+
links themselves.
4131+
41294132
Using `fs.stat()` to check for the existence of a file before calling
41304133
`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended.
41314134
Instead, user code should open/read/write the file directly and handle the

0 commit comments

Comments
 (0)