FabGL
ESP32 Display Controller and Graphics Library

◆ getFSInfo()

bool getFSInfo ( DriveType  driveType,
int  drive,
int64_t *  total,
int64_t *  used 
)
static

Gets total and free space on a filesystem.

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

Example:

// print used and free space on SPIFFS (Flash)
int64_t total, used;
FileBrowser::getFSInfo(fabgl::DriveType::SPIFFS, 0, &total, &used);
Serial.printf("%lld KiB used, %lld KiB free", used / 1024, (total - used) / 1024);

// print used and free space on SD Card
int64_t total, used;
FileBrowser::getFSInfo(fabgl::DriveType::SDCard, 0, &total, &used);
Serial.printf("%lld KiB used, %lld KiB free", used / 1024, (total - used) / 1024);

Definition at line 1309 of file fabutils.cpp.