if you are just writing xxxxxxx.txt , then try writing out the whole path for the textfile...that worked for me when i got the same error message