Localfilesystem - open file without deleting text inside.

25 Jan 2012

I want to open a local file on the Mbed, WITHOUT it erasing the text that already is inside the textfile, is that possible?

25 Jan 2012

yep..

I'm always replying to posts without exact code in front of me.

Sorry about that...

but what you need to do is instead of opening it as "w" write, which overwrites any existing file,

open it as "a" append, which keeps the existing file and lets you write into it.

cheers

Dave

<edit> FILE *fp = fopen("/sd/mydir/sdtest.txt", "a");

Note the a !