You're creating a file of which the name consists of nothing but a bunch of digits. I think it'd be saner of you to use a file extension. Choose one which your system can then associate with the kind of file it really is. You could start with appending ".txt" to your file name, for example, to get a feel for it.