mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
doc,fs: update description of fs.stat() method
PR-URL: https://github.com/nodejs/node/pull/47654 Fixes: https://github.com/nodejs/node/issues/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>
This commit is contained in:
1 parent
d4eecb5be9
commit
8651ea822e
1 file changed
+3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user