Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

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

S_nameTemplate

Template file name as a string or a symbol.

Value Returned

t_name

Path that can be used to create a file or directory.

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

Input Output Functions


Return to top
 ⠀
X