This command fstream::app says: All output operations are performed at the end of the file, appending the content to the current content of the file. This flag can only be used in streams open for output-only operations.
Is there any way I can use it to open the file without erasing current content and adding more?
If you have any other suggestions on how to do this please leave them bellow