Hello there!
I am implementing "append" like functionality by having 2 files parallel to each other (one of them is existing temporary only).
So I create and open temp. file, copy original file content to it, append new data, close the file, delete the original,
rename the temp. to the name of deleted original file.
I am thinking about alternative solution:
I would love to keep both files all the time existing to avoid problems by creating new files again and again:
0) create temp. and original file
.... (some writing to original file will happen in mean time)
1) open temp. file for writing
2) copy original file content to temp. file
3) write new data to temp. file (aka append)
4) close temp. file
5) close original file
6) rename original file to original_old
7) rename temp. file to original
8) rename original_old to temp. file
As this means also some writings to FLASH memory, is this solution better?
I am referring here to TI documentation:
Thank you in advance for response!
Regards
Jiří