Steve, I have another thread where I was having similar problems. First, if you search on your C drive for "text.txt", you will see that it is being created as Mobiius stated.
I was having trouble with my app overwriting files using the append=0 parameter in the WriteToFile function. I just found the problem. I have to run the compiled .exe as the "administrator" on my computer. I'm running Vista and I have run across this problem before. It a pain. I have to compile, file the .exe in file explorer, right click, and select to "run as adminsitrator".
This solved it for me. What OS are you running?