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

deleteFile

deleteFile( 
S_name 
) 
=> t / nil

Description

Deletes a file. The file name can be specified with either an absolute or relative path; the SKILL path is used in the latter case. If a symbolic link is passed in as the argument, it is the link itself, not the file or directory referenced by the link, that gets removed. A path that is anchored to the current directory, for example, ./, ../, or ../../.., and so on, is not considered as a relative path.

Arguments

S_name

Name of file you want to delete.

Value Returned

t

File is successfully deleted.

nil

File does not exist or signals an error if you do not have permission to delete a file.

Examples

In the following example, the named file exists and is deleted.

deleteFile("~/test/out.1") => t 

In the following example, the named file does not exist.

deleteFile("~/test/out.2") => nil 

When you do not have write permission for /bin, an error is printed about permission violation in CIW.

deleteFile("/bin/ls") 

Related Topics

Environment Functions

deleteDir


Return to top
 ⠀
X