As you don't have any problems related to connectivity or wireless or related to networking,
I advice you to re-issue your question/problem and choose the prober EE zone (I think it would be related to programming)
What I can guess (Although I am not professional in coding) is that you could successfully created the file, but couldn't put the contents in it.