hmFS.close(fileId)
For an introduction to the Zepp OS Mini Program file system, please refer to File System.
Close file handle.
Type
(fileId: number) => result
Parameters
fileId
| Description | Type |
|---|---|
| File handle, returned when the file is opened | number |
result
| Description | Type |
|---|---|
result, 0 get success | number |
Please refer to File System - Error Code for the rest of the error codes.
Code example
Page({
build() {
const fileId = hmFS.open('test_file.txt', hmFS.O_RDWR | hmFS.O_CREAT)
hmFS.close(fileId)
}
})