EasyManuals Logo

Tektronix Keithley 2601B-PULSE Reference Manual

Tektronix Keithley 2601B-PULSE
849 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
Page #441 background imageLoading...
Page #441 background image
Model 2601B-PULSE System SourceMeter Instrument Reference Manual Section 11: TSP command reference
2601B-PULSE-901-01A April 2020 11-83
Also see
waitcomplete() (on page 11-393)
fileVar:close()
This function closes the file that is represented by the fileVar variable.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
fileVar:close()
fileVar
The file descriptor variable to close
Details
This command is equivalent to io.close(fileVar).
Note that files are automatically closed when the file descriptors are garbage collected.
Example
local fileName = "/usb1/myfile.txt"
if fs.is_file(fileName) then
os.remove(fileName)
print("Removing file")
else
print("Nothing removed")
end
print("\n*** fileVar:close")
do
myfile, myfile_err, myfile_errnum = io.open(fileName, "w")
myfile:write("Line 1")
myfile:close()
end
myfile, myfile_err, myfile_errnum = io.open(fileName, "r")
myfile:close()
os.remove(fileName)
Opens file myfile.txt for writing. If no errors were found while opening, writes Removing file and closes
the file.
Also see
fileVar:flush() (on page 11-84)
fileVar:read() (on page 11-85)
fileVar:seek() (on page 11-86)
fileVar:write() (on page 11-88)
io.close() (on page 11-102)
io.open() (on page 11-104)

Table of Contents

Other manuals for Tektronix Keithley 2601B-PULSE

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tektronix Keithley 2601B-PULSE and is the answer not in the manual?

Tektronix Keithley 2601B-PULSE Specifications

General IconGeneral
BrandTektronix
ModelKeithley 2601B-PULSE
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals