doc: clarify how fs.Dirent file types are determined · nodejs/node@89aba0c · GitHub
Skip to content

Commit 89aba0c

Browse files
soreavisaduh95
authored andcommitted
doc: clarify how fs.Dirent file types are determined
The file type of a directory entry returned by fs.readdir() or fs.opendir() is the type reported by the operating system's directory listing. Node.js falls back to lstat() only when the reported type is unknown, and some file systems may report a type that differs from what lstat() would return. Document this in the fs.Dirent class introduction, with fs.lstat() as the accurate alternative. Fixes: #30646 Signed-off-by: Julian Soreavis <julian.soreavis@gmail.com> PR-URL: #64532 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jason Zhang <xzha4350@gmail.com>
1 parent 3ed0492 commit 89aba0c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

doc/api/fs.md

Lines changed: 7 additions & 0 deletions

0 commit comments

Comments
 (0)