How do I open a file and the close it?