Can't overwrite a file on a sd card on an intel edison

140 views Asked by At

I am writing to a file on an sd card on an intel edison. I use File f = sd.open("filename.txt", FILE_WRITE); f.write("something"); f.close();' In a loop. Instead of overwriting what was previously on filename.txt, which i assumed to be the default, it is just appended to the bottom.

Does anyone know how to overwrite the file without deleting it every time? Even if it's some sort of function that clears the file then writes to it each time.

Thanks

0

There are 0 answers