I want to write program that save several megabytes to disk and report to user that "all ok, your data is safe".
So if after my program report that all ok powerloss happens or something like this, data in file should not be lost or damanged with high probability.
As I know on Linux you most probably get this done by using:
open(tempname), write(tmpfile), fsync(tmpfile), close(tmpfile), fsync(dir), rename(), fsync(dir)
as described https://lwn.net/Articles/457667/ ,
is any crate to make it in cross platfrom way, at least for Mac/Linux/Windows?
By the way, as know sqlite do it in right way, but sqlite for my task is overkill.