if temp directory not specified, automatically create one that doesn't collide with other files in the directory