Tektronix KEITHLEY SourceMeter 2606B Reference Manual page 492

Table of Contents

Advertisement

Model 2606B System SourceMeter® Instrument Reference Manual
io.open()
This function opens a file for later reference.
Type
TSP-Link accessible
Function
No
Usage
fileVar, errorMsg = io.open("path")
fileVar, errorMsg = io.open("path", "mode")
fileVar
errorMsg
path
mode
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 used to access the file.
If an error is encountered, the command returns nil for fileVar and an error string.
Example
testFile, testError = io.open("testfile.txt", "w")
if testError == nil then
testFile:write("This is my test file")
io.close(testFile)
end
Also see
io.close()
(on page 15-117)
io.output()
This function assigns a previously opened file or opens a new file as the default output file.
Type
TSP-Link accessible
Function
Yes (see Details)
Usage
fileVar = io.output()
fileVar = io.output("newfile")
fileVar
newfile
2606B-901-01 Rev. C November 2021
Affected by
The descriptor of the opened file
Indicates whether an error was encountered while processing the function
The path of the file to open
A string representing the intended access mode ("r" = read, "w" = write, and "a" = append)
Affected by
The descriptor of the output file or an error message (if the function fails)
A file descriptor to assign (or the path of a file to open) as the default output file
Section 15: TSP command reference
Where saved
Default value
Opens file testfile.txt for writing.
If no errors were found while opening,
writes "This is my test file" and
closes the file.
Where saved
Default value
15-119

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the KEITHLEY SourceMeter 2606B and is the answer not in the manual?

Table of Contents