reopen files that close in append mode