Esp32S3 : VFS Component. How to determine Freemem and Used mem on a FileSystem ?

ThomasESP32
Posts: 229
Joined: Thu Jul 14, 2022 5:15 am

Esp32S3 : VFS Component. How to determine Freemem and Used mem on a FileSystem ?

Postby ThomasESP32 » Thu Jun 27, 2024 12:43 pm

Good afternoon,

I am working on a firmware running on an Esp32S3.
I have 3 partitions that are "referenced" using Virtual FileSystem component and a FileSystem is mounted on each partition.

Using VFS, is there a way to determine the amount of free memory (In bytes) and the amount of used memory (In bytes)
available on each FileSystem ?

Thank you for your help,
Best regards,

Thomas TRUILHE

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: Esp32S3 : VFS Component. How to determine Freemem and Used mem on a FileSystem ?

Postby ESP_Sprite » Fri Jun 28, 2024 1:28 am

For reference, on other Posix OSses, you'd do it by running stat() on the directory where the filesystem is mounted. Potentially newlib has the same convention.

Who is online

Users browsing this forum: No registered users and 234 guests