I write Server for client-server application in C. I have to save logs to file.
I write it into a file using fprintf, but when the server go down I lost the data in the file, cause I don’t close filedescriptor, is there any function which tell my program save the data?
Thx
If you fflush after every fprintf it helps.