diff options
author | Mert Can Altın <mertgold60@gmail.com> | 2023-04-23 08:52:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-23 05:52:00 +0000 |
commit | 511d40cecd8dd8aa15c288f8037f398fe7186ae0 (patch) | |
tree | 313895fb1828a5e5d19adbfc63eea928b61341c5 /doc/api | |
parent | 0c5f253339618e95da01d89cd7f036bfa1e8b33c (diff) | |
download | node-new-511d40cecd8dd8aa15c288f8037f398fe7186ae0.tar.gz |
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>
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/fs.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index a331677469..0623e1c5a9 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -4126,6 +4126,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 |