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: nodejs#47654
Fixes: nodejs#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>
  • 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.