I am writing images to disk using cv::imwrite, but I need to make sure that the file is sync to disk after that function returns. Is there a way to guarantee that?
In order to use the system call fsync, I need a file descriptor, which I have no access when using cv::imwrite. Is there any work-around this?
You can use following system call that syncs the whole system:
Don't forget to include stdlib.h