mirror of
https://github.com/nodejs/node.git
synced 2026-10-07 05:14:42 -04:00
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: https://github.com/nodejs/node/issues/30646 Signed-off-by: Julian Soreavis <[email protected]> PR-URL: https://github.com/nodejs/node/pull/64532 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jason Zhang <[email protected]>