fflush for file write. In Clion, run with debug mode