Skip to content

Commit

Permalink
doc,fs: update description of fs.stat() method
Browse files Browse the repository at this point in the history
PR-URL: #47654
Fixes: #47633
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: LiviaMedeiros <[email protected]>
  • Loading branch information
mertcanaltin authored and MoLow committed Jul 6, 2023
1 parent d4eecb5 commit 8651ea8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4066,6 +4066,9 @@ Asynchronous stat(2). The callback gets two arguments `(err, stats)` where

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

[`fs.stat()`][] follows symbolic links. Use [`fs.lstat()`][] to look at the
links themselves.

Using `fs.stat()` to check for the existence of a file before calling
`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended.
Instead, user code should open/read/write the file directly and handle the
Expand Down

0 comments on commit 8651ea8

Please sign in to comment.