stats.isDirectory()
- 返回: <boolean>
如果 <fs.Stats> 对象描述的是文件系统目录,则返回 true。
【Returns true if the <fs.Stats> object describes a file system directory.】
如果从对符号链接调用 fs.lstat() 获取了 <fs.Stats> 对象,而该符号链接指向一个目录,则此方法将返回 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.】