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

simplifyFilename

simplifyFilename( 
t_name 
[ g_dontResolveLinks ]
) 
=> t_result

Description

Expands the name of a file to its full path.

Returns the fully expanded name of the file t_name. Tilde expansion is performed, “./” and “../” are compressed, and redundant slashes are removed. By default, symbolic links are also resolved, unless the second (optional) argument g_notResolveLinks is specified to non-nil.

If t_name is not absolute, the current working directory is prefixed to the returned file name.

Arguments

t_name

File to be fully expanded.

g_dontResolveLinks

If specified to non-nil, symbolic links are not resolved.

Value Returned

t_result

Fully expanded name of the file.

Examples

Assumes the user’s home directory is /usr/mnt/user.

simplifyFilename("~/test") 
=> "/usr/mnt/user/test"

Assumes /tmp/fileName is a symbolic link of /tmp/fileName.real.

simplifyFilename( "/tmp/fileName" t) 
=> "/tmp/fileName"

Related Topics

Input Output Functions

isFileName


Return to top
 ⠀
X