title: fprintf stops working after performing external edit
body: <p>I have a c++ program, A, that opens a file for append using fopen(file_name,"a");  The file is written to via fprintf().  Everything works fine until I edit the file from another session (e.g. using vim); this is necessary to do during debugging.  After saving the file program from the vim session, A stops writing to the file.  I've checked and the fprintf() is working fine as far as I can tell; as expected the return value equals the number of bytes written, but nothing shows up in the file.  Can someone explain why this occurring?  Specifically is there a way for program A to detect this situation and 'do something about it; e.g. close and reopen the file.</p>