EasyManua.ls Logo

Tektronix KEITHLEY 2600B Series

Tektronix KEITHLEY 2600B Series
834 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Section 9: TSP command reference Series 2600B System SourceMeter® instrument Reference Manual
9-120 2600BS-901-01 Rev. F/August 2021
io.output()
This function assigns a previously opened file or opens a new file as the default output file.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
Yes (see Details)
Usage
fileVar = io.output()
fileVar = io.output("newfile")
fileVar
The descriptor of the output file or an error message (if the function fails)
newfile
A file descriptor to assign (or the path of a file to open) as the default output file
Details
The path of the file to open may be absolute or relative to the current working directory.
When accessed from a remote node using the TSP-Link network, this command does not accept a
file descriptor parameter and does not return a value.
If the function fails, an error message is returned.
Example
local fileName = "/usb1/myfile.txt"
if fs.is_file(fileName) then
os.remove(fileName)
print("Removing file")
else
print("Nothing removed")
end
errorqueue.clear()
print("\n*** io.output")
myfile, myfile_err, myfile_errnum = io.open(fileName, "w")
myfile:write("Line 1")
myfile:close()
do
fileHandle = io.output(fileName)
print(fileHandle)
end
io.close(fileHandle)
print(fileHandle)
os.remove(fileName)
Assign the file to be the default output file.
Also see
io.input() (on page 9-118)
io.open() (on page 9-119)

Table of Contents

Related product manuals