Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hi,
Is it possible to write a file to the mbed without overwriting the old one.I'm writing the values from an array to a local file. But when i do another measurment, i want to write another file (thus preventing the exising one to be overwritten).
void WriteVal() { // Writing the values in array to file onto disk. pc.printf("Writing to disk (be patient) \n\r"); FILE *fp = fopen("/local/testfile.txt", "w"); if (!fp) { fprintf(stderr, "File could not be openend \n\r"); exit(1); main(); } wait(2.0); for (int i=0; i < NR_SAMPLES; i++) { fprintf(fp," %i \n\r", samples[i]); } pc.printf("closing file"); fclose(fp); wait(2.0);; main(); }How can i solve this ?