in reply to What is the point of a+ and w+ when opening files?
A recent case where I have opened a file "a+" is for a (C) program writing details of progress on a long calculation to a logfile. On startup, if the logfile already exists, I parse what has been written to discover the point from which the calculation should be resumed.
(Since then I have changed it to open "r" for the parsing, then reopen "a" for normal operation - the "a+" logic worked fine for me on Linux, but appeared to cause problems for others on Windows (via CygWin).)
|
|---|