makeTempFileName
makeTempFileName(S_nameTemplate) =>t_name
Description
Appends a string suffix to the last component of a path template so that the resulting composite string does not duplicate any existing file name.
That is, it checks that such named file does not exist. SKILL path is not used in this checking.
The last component of the resultant path is guaranteed to be no more than 14 characters. If the original template has a long last component it is truncated from the end if needed. Also, any trailing X’s (uppercase only) are removed from the template before the new string suffix is appended. You are encouraged to follow the convention of placing temporary files in the/tmp directory on your system.
Arguments
Value Returned
Examples
In the following example, trailing X's (uppercase only) are removed.
d = makeTempFileName("/tmp/testXXXX")
=> "/tmp/testa00324"
In the following example, the name is used this time.
createDir(d)
=> t
A new name is returned this time.
makeTempFileName("/tmp/test")
=> "/tmp/testb00324"
Related Topics
Return to top