added cleanup_tmpfiles(), create_tmpdir() can set directory, only create files that don't exist already