File *

Can anyone tell me how to refresh the content of a FILE *, so that without reopening you can read its modyfied contents? I was adviced to make the FILE * unbuffered, so I did using setvbuff(), everything compiled smoothly, but it just didnt refresh the file, after it was opened. What should I do? Are any other related functions?

Once you have unbuffered the file every read will get the data from the file system cache, invoking a physical read if necessary. This the best that your program can do.

But if another program is writing to the file, it may be using buffered i/o. In this case, you will not see new data until the other program flushes its internal buffer.