in reply to unable to open existing file after trying to open a non-existing one
Update: While the above statement is true, the OP is not confused. I'm the one who is confused about what OP's code was doing. Apologies.