File should be closed after opening.