# Stats FileSystemManager.fstatSync(Object object)
Start from base library version 2.16.1. Please remaining backward compatible.
with Promise style call: Not supported
Mini Program plugin: Support, need to Mini Program base library version no less than 2.19.2
Synchronize access to file status information
# parameter
# Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
fd | string | yes | File descriptor. fd adopt FileSystemManager.open or FileSystemManager.openSync Interface acquisition |
# Return value
# Stats
Stats Object that contains the state of the file
# error
Error code | Error message | Introductions |
---|---|---|
bad file descriptor | Invalid file descriptor | |
fail permission denied | Specified fd Path not read |
# sample code
const fs = wx.getFileSystemManager()
const fd = fs.openSync({
filePath: `${wx.env.USER_DATA_PATH}/hello.txt`,
flag: 'a+'
})
const stats = fs.fstatSync({fd: fd})
console.log(stats)