Skip to main content
Version: v1.0

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

DescriptionType
File handle, returned when the file is openednumber

result

DescriptionType
result, 0 get successnumber

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)
}
})