I recommend you to have a look
here[
^]
You are opening and closing the file. By closing you disassociate the file of the fstream.
quote from the site:
Once closed, the same file stream object may be used to open another file
[/quote]
On the other hand... open file does not necessary mean create file.