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

infile

infile( 
S_fileName 
) 
=> p_inport / nil 

Description

Opens an input port ready to read a file. Always remember to close the port when you are done.

The file name can be specified with either an absolute path or a relative path. In the latter case, current SKILL path is used if it’s not nil. A path that is anchored to the current directory, for example, ./, ../, or ../../.., and so on, is not considered as a relative path.

Always remember to close the port when you are done.

Arguments

S_fileName

Name of the file to be read; it can be either a string or a symbol.

Value Returned

p_inport

Port opened for reading the named file.

nil

The file does not exist or cannot be opened for reading.

Examples

If such a file exists and is readable.

in = infile("~/test/input.il") 
=> port:"~/test/input.il"

If myFile does not exist according to the current setting of the SKILL path or exists but is not readable.

infile("myFile") 
=> nil
close(in) 
=> t

Related Topics

close

isFileName

isReadable

outfile

portp


Return to top
 ⠀
X