nonexistent files have to be opened in write mode