Skip to main content
Version: v3+

hmFS.stat_asset(path)

Get information about the files in the application assets directory.

Type​

(path: string) => [stat, err]

Parameters​

path​

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

stat​

PropertiesDescriptionType
sizeNumber of bytes of the filenumber
mtimeFile last modified time in UTC secondsnumber

err​

DescriptionType
Error code, 0 means get successnumber

Usage​

const [fs_stat, err] = hmFS.stat_asset('test_file.txt')

if (err == 0) {
console.log('--->size:', fs_stat.size)
} else {
console.log('err:', err)
}