sample code for generating tmp file for output