http://codereview.stackexchange.com/questions/38148/updating-a-file-through-c-streams : jliv902's code review