is it possible to rename files on a SD card?
At the moment I am filling up a file with data. at the end of the month, it should be named with the name of the month and the year (e.g. may21) and a new file should be created.
That's what I have:
If It's not possible to rename the file and create a new one, maybe you can copy it with a new name and delete the old one? Or maybe you can read it somehow and write the content in a new created file?
I am using an esp8266.
The maximum size of the file will be only a few kB.
The SD library doesn't support renaming and it doesn't support having multiple files open at the same time so you can't just read one in and write it out (easily).
Why not just create the filename based on the current date from the start? In the current month, the filename will be "Sep21.txt" and on the first of next month, you start writing to "Oct21.txt". No renaming required.
ok, you are probably right.
so, I am not that good in programming. how would the code look like?
my month-name variable is tm.tm_mday
maybe you could add it into my code easyly?