[BUG:ESP32:LittleFS] Cannot rotate chart data #40

Closed
opened 2025-04-12 02:44:06 +02:00 by DeltaLima · 2 comments
Owner

When rotating on ESP32, deleting old files failes with error message, that the FD (file descriptor) is still open.

Maybe this is helpful: https://www.b4x.com/android/forum/threads/problem-deleting-files-with-littlefs.143882/

When rotating on ESP32, deleting old files failes with error message, that the FD (file descriptor) is still open. Maybe this is helpful: https://www.b4x.com/android/forum/threads/problem-deleting-files-with-littlefs.143882/
Author
Owner

from the linked forum post i think a way to workaround this issue is to store all filenames for deletion into an array.
The array can be an unsigned long because I already convert the filename to it to compare it as number.

Maybe I have to iterate over all files twice. Onetime to count the total number of files, then initialize the array with the size of counted files in total, then iterate a second time, compare the filenames if they are ready for deletion. If so, store the filname as unsigned longl into the array. delete only, when filename > 0

from the linked forum post i think a way to workaround this issue is to store all filenames for deletion into an array. The array can be an `unsigned long` because I already convert the filename to it to compare it as number. Maybe I have to iterate over all files twice. Onetime to count the total number of files, then initialize the array with the size of counted files in total, then iterate a second time, compare the filenames if they are ready for deletion. If so, store the filname as `unsigned longl` into the array. delete only, when `filename > 0`
Author
Owner

solved

solved
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
DeltaLima/CanGrow#40
No description provided.