I have written a daemon that writes a value in a file. What I have observed is that when I keep writing on a file, there is nothing visible in the file. in other hand, If I
By default, stdio is fully buffered, unless it's writing to a terminal, in which case it's line-buffered, or stderr, which is not buffered at all.
You can disable buffering with the setbuf() function.
setbuf()
setbuf(fp, NULL);