描述文件状态的对象。
属性:
起始版本: 1.0.4
| 参数 | 类型 | 描述 |
|---|---|---|
| mode | number | 文件的类型和存取的权限。 |
| size | number | 文件大小,单位:Byte。 |
| lastAccessedTime | number | 文件最近一次被存取或被执行的时间,unix时间戳。 |
| lastModifiedTime | number | 文件最后一次被修改的时间,unix时间戳。 |
Stats.isDirectory(): boolean
判断当前文件是否一个目录。
起始版本: 1.0.4
示例:
const fileSystemManager = has.getFileSystemManager();
const fd = fileSystemManager.openSync({
filePath: 'internal://cache/test.txt'
});
const stats = fileSystemManager.fstatSync({
fd: fd
});
console.info(stats.isDirectory());