use old temp file name generation method. don't print temp file path.
bug fix: we need to check isDirectory(), not exists()