Use open() so the file handler is closed OK