esp8266 littleFS edit data on a text file

76 views Asked by At

In a project I use NODEMCU ESP8266 and using webserver I can create a text file by LittleFs and write data in it. I use this file as a database and store user information in it. During the project, user information changes. For example, the person's address is added. Is there a way to edit this information? Or should I create a new file and transfer the information to this new file? I didn't find anything in the LittleFs library to edit the information in the middle of the file. For example, the initial data is like this.

user1 name:Jack,tel:#####
user2 name:Alex,tel:#####

And the edited data should be as follows.

user1 name:Jack,tel:#####,address:$$$$
user2 name:Alex,tel:#####

Thanks a lot ...

0

There are 0 answers