pellepl / spiffs

Wear-leveled SPI flash file system for embedded devices
MIT License
1.52k stars 402 forks source link

Question regarding overwriting data #293

Open crisvdn opened 1 year ago

crisvdn commented 1 year ago

What is the correct usage of overwriting data in a file, without clearing bits of flash?

Our use case is the following: We have multiple files with settings. When a setting value is changed, only that specific field should be changed. Now, the data is appended in that specific file. Should I open the file in a different mode and just write to it? (so it overwrites?).

I am worried that this might reset the bits and increases wear on flash, is this the way to go and handled in the API?

The other option is just delete the file and create it again with new data?