use mkstemp to create tmp filename.
remove tmp filename