printng - fix tmp file handling, close files