fs - Additional File System Operations#

Adapted Air780E/Air700E Air780EP Air601 Air101/Air103 Air105 ESP32C3 ESP32S3

Note

This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!

Tip

This library has its own demo,click this link to view the demo example of fs

fs.fsstat(path)#

Obtaining File System Information

Parameters

Incoming Value Type

Explanation

string

Path, default “/”, optional

Return Value

return value type

explanation

boolean

Returns true for successful acquisition, otherwise false

int

Total number of blocks

int

Number of used blocks

int

block The size of, in bytes

string

File system type, for example, lfs represents littlefs

Examples

-- Print information about the root partition
log.info("fsstat", fs.fsstat("/"))

fs.fsize(path)#

Get File Size

Parameters

Incoming Value Type

Explanation

string

File Path

Return Value

return value type

explanation

int

File size, which is returned if the acquisition fails.0

Examples

-- Print size of main.luac
log.info("fsize", fs.fsize("/main.luac"))