Function Description

SD card read and write operations

open sdcard file mode Open a specified file and perform read or write operations. In 'r' and 'r+' modes, the file must exist, otherwise, an error is reported. In 'a', 'w', and 'w+' modes, if the file does not exist, it will be created automatically.

file read all Read all content in the file

file read bytes Read a specified number of bytes

file read line Read one line of content

file write Write content to the file

file set seek Set the offset position for reading

file get seek Get the current offset position

sdcard listdir List files in the specified directory

file mkdir Set the offset position for reading

sdcard remove Delete a specified file

sdcard rmdir Delete a specified directory

sdcard rename Rename a file

Usage Instructions

Create a folder named test, establish a file named TEST.text, write "helloM5Stack" into it, and read from M5Stack

On This Page