The difference between temefile and tempnam :
1. The file created by tempnam will not be deleted automatically and needs to be deleted manually; the file created by tempfile will be automatically deleted when the handle fclose() is called.
2. tempname can specify the creation path, but temefile cannot.