Hi to all, i've a new issue: i've created a binary file that contains some settings for my arduino project. How can I replace existing data in the file with some new data? The SD standard library doesn't contains an erase method and i've googled for finding other libraries, but i don't find anithing intresting. Can you suggest me something?
Open the file, for read. Read everything into memory. Close the file.
Change what you want in memory.
Open the file, for write. Write everything in memory. Close the file.
Viola, new data in the file.
If you open a file for write, and that file already exists, it can be overwritten, if the right options are used to open the file (O_WRITE | O_CREAT | O_TRUNC will open the file for write, creating it if it doesn't exist, and truncating it's length to 0 if it does).