Skip to main content
Version: Next

Stats

Describes the status of a file.

Methods

PropertyTypeDescription
lastAccessedTimenumberThe time when the file was last accessed or executed, in the UNIX timestamp format, corresponding to POSIX stat.st_atime.
lastModifiedTimenumberThe time when the file was last modified, in the UNIX timestamp format, corresponding to POSIX stat.st_mtime.
modestringFile type and access permission, corresponding to POSIX stat.st_mode.
sizenumberFile size in bytes, corresponding to POSIX stat.st_size.

isDirectory

Determines whether the current file is a directory.

Reference

() => boolean

API Support

APIWeChat Mini-ProgramH5React Native
Stats.isDirectory✔️

isFile

Determines whether the current file is a normal file.

Reference

() => boolean

API Support

APIWeChat Mini-ProgramH5React Native
Stats.isFile✔️

API Support

APIWeChat Mini-ProgramH5React Native
Stats.isDirectory✔️
Stats.isFile✔️