Closing #1 after power failure


Author Message
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8939
Posted: 03:58pm 11 Sep 2021      

Close#n writes anything remaining in buffer n followed by an EOF character IIRC. If that's so then only a UPS can save the data, as toml says.

Another way is to save data to battery-backed RAM until you have enough to write a block to the SD card then open the file, write the block, close it and delete the RAM. It may be possible to do this by using the registers on a RTC.