Skip to main content
Version: v1.0

open_asset

For an introduction to the Zepp OS Mini Program file system, please refer to File System.

Open the files in the /assets directory of the Mini Program, the /assets directory is read-only.

Type​

(path: string, flag: FLAG) => fileId

Parameters​

path​

DescriptionRequiredTypeDefault
Mini Program's /assets directory file name (relative path)yesstring-

FLAG​

Optional PropertiesDescription
O_RDONLYread-only

fileId​

DescriptionType
file handlenumber

Code example​

Page({
build() {
const fileId = hmFS.open_asset('test_file.txt', hmFS.O_RDONLY)
}
})