I'm not sure why those two lines of code don't work for you. I tossed them into a script and it removed the "output.txt" file just fine. Perhaps something before you attempt to unlink the file is causing you problems? What error are you getting from this? That might be helpful for us to know as well.