2012-12-04 03:50 AM
Sorry for the trivial question but I need to add some data to a text file on the fly.
Each time I need to open an existing file and add a line of text to it then close (to avoid data loss on power off)I'm new to a FS programming and I can't find the option for append (a+). Can I do it on the stm3220g-eval? Do I have to read the entire file content then create a new file to store the data in it? #stm3220g-eval #fs-f_lseek-stm3220g-eval #fat-stm32 #file-system #filesystem #fatfs2012-12-04 05:53 AM
Trivial in the sense you could read the documentation, use FA_OPEN_ALWAYS, along with FA_READ/WRITE, and f_lseek to the end of the file
http://elm-chan.org/fsw/ff/en/open.html
2012-12-04 05:56 AM
Do you mean FatFs ?
If so, the documentation is here: - note also the Resources links...''Each time I need to open an existing file and add a line of text to it then close (to avoid data loss on power off)'' If you are using FatFs, see: FatFs, Filesystem, File System2012-12-04 10:47 AM
Thanks a lot,
I fund the f_lseek but it didn't work(it kept crashing) . Then I found the bug in a whole different location.
Now it works perfectly!!!