FabGL
ESP32 Display Controller and Graphics Library

◆ format()

bool format ( DriveType  driveType,
int  drive 
)
static

Formats SPIFFS or SD Card.

The filesystem must be already mounted before calling Format(). The formatted filesystem results unmounted at the end of formatting, so remount is necessary.

Parameters
driveTypeType of support (SPI-Flash or SD Card).
driveDrive number (Can be 0 when only one filesystem is mounted at the time)
Returns
Returns True on success.

Example:

// Format SPIFFS and remount it
FileBrowser::format(fabgl::DriveType::SPIFFS, 0);
FileBrowser::mountSPIFFS(false, "/spiffs");

Definition at line 1134 of file fabutils.cpp.