7: TSP command reference Series 2600B System SourceMeter® Instrument
7-108 2600BS-901-01 Rev. B / May 2013
io.input()
This function assigns a previously opened file, or opens a new file, as the default input file.
Type TSP-Link accessible Affected by Where saved Default value
Usage
fileVar = io.input()
fileVar = io.input(newfile)
The descriptor of the input file or an error message (if the function fails)
A string representing the path of a file to open as the default input file, or the
file descriptor of an open file to use as the default input file
Details
The newfile path may be absolute or relative to the current working directory.
When using this function from a remote TSP-Link
®
node, this command does not accept a file descriptor and
does not return a value.
If the function fails, an error message is returned.
Also see
io.open() (on page 7-108)
io.output() (on page 7-109)
io.open()
This function opens a file for later reference.
Type TSP-Link accessible
Affected by Where saved Default value
Usage
fileVar, errorMsg = io.open(path)
fileVar, errorMsg = io.open(path, mode)
The descriptor of the opened file
Indicates whether an error was encountered while processing the
The path of the file to open
A string representing the intended access mode ("r" = read,
= write, and
= append)
Details
The path to the file to open may be absolute or relative to the current working directory. If you successfully open
the file, errorMsg is nil and fileVar has the descriptor that can be used to access the file.
If an error is encountered, the command returns nil for fileVar and an error string.