Do you really want to write exactly the same contents to all the files? If so, it might be more efficient to write to one single file, close it, and make copies of the file afterward.
Je suis Charlie.
Comment on Re: Creating multiple files and writing in each file