Open the file when required.