Open a file when the buffer is empty