write csv files to tmp