Writing to SD card ??

Hi, I have a Uno plus GPS shield with an SD card.

The example program suggests opening the file, writing data and closing the file, followed by a delay of 10-seconds, being frequent enough for GPS logging. All well and good, but this is in the main Loop so what happens if I disconnect power and it just happens to be before the "dataFile.close();

I can live with it not writing the last lot of data, but does shutting down before the file is closed do anything bad? Like - trashing the entire file?

I have tried removing power about a dozen times and the file is always OK with something in it, but, no guarantee it will always be that way. I realize the Open, Write and Close is all very quick, but… :slight_smile:

Thanks

Should be ok, I assume you’re writing to a csv file or other text type file. If so, your last record may just not write. Bit only if you happen to unplug while it is writing.