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 fs.lstat()
, this method will
always return false
. This is because fs.lstat()
returns information
about a symbolic link itself and not the path it resolves to.