Final answer:
To write to a file without erasing existing content, open it in append mode ('a'). New data is added to the end of the file.
Step-by-step explanation:
If you want to write data to a file without erasing the file's existing contents, you should open the file in append mode. In programming languages like Python, you can open a file in append mode by using the 'a' mode when you call the open function.
When you write data to a file in append mode, the data is written to the end of the file, following the existing content without overwriting it. This mode is useful for logging activities or adding content to a file over time without disturbing the original contents.