GRV-EPIC-PR1 Shell Access - Writing Files with c++

This post is more a question about how the EPIC’s Linux distribution handles file writing. We have an application that periodically writes some setpoints to disk. We have an SSH user and under that we save a simple JSON string in a folder. We had an issue that very intermittently our application would lose this file upon a power failure, where the file would look corrupted and fail to deserialize. This happens more frequently during commissioning when our technicians are cycling power.

Do the EPIC’s have some kind of write-caching? After doing some research that seemed to be the most likely scenario, and I have been unable to replicate the issue in testing after sending a system “sync” commands after writing the file.

We are using the standard c++ libraries. In this case std::ofstream, to write the files to disk.

I apologize if this is documented somewhere. It is kind of a pain to troubleshoot the cause, or to know if I am even on the right track, as it only occurs on power failures (and the EPIC boot times are pretty long).

Thanks,
-Peter