Skip to content

Commit 02e8709

Browse files
committed
doc,fs: update description of fs.stat() method
1 parent 472ffde commit 02e8709

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/fs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4126,6 +4126,10 @@ 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, [`fs.lstat()`][] looks at the links
4130+
themselves. Therefore, it is recommended to use [`fs.lstat()`][] when the links
4131+
themselves need to be examined.
4132+
41294133
Using `fs.stat()` to check for the existence of a file before calling
41304134
`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended.
41314135
Instead, user code should open/read/write the file directly and handle the

0 commit comments

Comments
 (0)