file is created and written to