# undefined FileSystemManager.closeSync(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 Close Files
# parameter
# Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
fd | string | yes | File descriptor that needs to be closed. fd adopt FileSystemManager.open or FileSystemManager.openSync Interface acquisition |
# Return value
# undefined
# error
Error code | Error message | Introductions |
---|---|---|
bad file descriptor | Invalid file descriptor |
# sample code
const fs = wx.getFileSystemManager()
const fd = fs.openSync({
filePath: `${wx.env.USER_DATA_PATH}/hello.txt`,
flag: 'a+'
})
// Close file
fs.closeSync({fd: fd})