stats.isDirectory()


如果 <fs.Stats> 对象描述文件系统目录,则返回 true

¥Returns true if the <fs.Stats> object describes a file system directory.

如果 <fs.Stats> 对象是通过在解析为目录的符号链接上调用 fs.lstat() 获得的,则此方法将返回 false。这是因为 fs.lstat() 返回有关符号链接本身的信息,而不是它解析到的路径。

¥If the <fs.Stats> object was obtained from calling fs.lstat() on a symbolic link which resolves to a directory, this method will return false. This is because fs.lstat() returns information about a symbolic link itself and not the path it resolves to.