w/out temp_dir uses tmpfile()