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.
Arguments
|
Name of the file to be read; it can be either a string or a symbol. |
Value Returned
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
Return to top