FTDI Community

General Category => Discussion - Software => Topic started by: forcetronics on August 11, 2018, 05:48:39 PM

Title: Trouble appending data to an existing file
Post by: forcetronics on August 11, 2018, 05:48:39 PM
Hello,

I am trying to append data or text to an existing file. I am able to open the existing file but I always write over the existing data instead of appending new data to the existing data. See my code below. Do I need to use a function like "f_lseek" to change the writing position of the file? Any help would be appreciated.

Here is how I open the file:
res = f_open(&f, EXAMPLE_FILE, FA_WRITE | FA__WRITTEN | FA_OPEN_EXISTING/*| FA_CREATE_NEW*/);

Here is the function used to write data:
f_write(&f, data, towrite, &written);
Title: Re: Trouble appending data to an existing file
Post by: FTDI Community on August 13, 2018, 01:14:04 PM
Hello,

Can you just clarify which product you are using?

Best Regards,
FTDI Community