PlatformIO Community

ESP_VFS get total bytes / used bytes

I have a few different virtual filesystem mounts (SPIFFS on ‘/’, SDFS on ‘/sd’) and I need to know how much space is available in each when working in that path. It doesn’t appear that ‘statvfs’ is available. How would I do this in esp-idf?

Any help is appreciated.

For SD card: https://github.com/espressif/esp-idf/blob/16a4ee7c36a848ca155791677ce011f3ca75c519/components/sdmmc/sdmmc_common.c#L256-L280

For SPIFFS: https://github.com/espressif/esp-idf/blob/master/examples/storage/spiffs/main/spiffs_example_main.c#L57-L64

Ok… I was hoping for an esp_vfs function that I could call for either path that would give me the info without having to handle each individually. Thanks.

Maybe Espressif people know more than me. Try posing the question on https://esp32.com/ explicitly.