# Adding text to an existing file arrgghh

**URL:** <https://forum.kirupa.com/t/adding-text-to-an-existing-file-arrgghh/286933>\
**Category:** Uncategorized\
**Created:** [April 23, 2009, 4:20am UTC](https://forum.kirupa.com/t/adding-text-to-an-existing-file-arrgghh/286933 "2009-04-23T04:20:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![almondo](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@almondo](https://forum.kirupa.com/u/almondo)\
**Post date:** [April 23, 2009, 4:20am UTC](https://forum.kirupa.com/t/adding-text-to-an-existing-file-arrgghh/286933/1 "2009-04-23T04:20:22Z")

</div>

Hi

Just wondering if you can help me on how i can add text to an existing file instead of overwriting it… ive got this far…

string filePath = “C:\ ex1.txt”; StreamWriter foo; if (File.Exists(filePath)) { // File exists // Don’t do anything.} else { // File does not exist foo = new StreamWriter(filePath); foo.Write(“Blarg. Zorb. Zeeb. Foo.”); foo.Close();}  
I hope that makes sense!!  
Thanks
