
Model 2461 Interactive SourceMeter® Instrument Reference Manual
Section 8: TSP command reference
2461-901-01 A/November 2015
8-73
Details
Note that files are automatically closed when the file descriptors are garbage collected.
Example
file_num = file.open("/usb1/GENTRIGGER", file.MODE_WRITE)
file.close(file_num)
Open the file
GENTRIGGER
for writing, then close it.
Also see
(on page 8-74)
file.flush()
This function writes buffered data to a file on the USB flash drive.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
file.flush(
fileNumber
)
fileNumber
The file number returned from the
file.open()
function to flush
Details
The
file.write()
function may buffer data instead of writing immediately to the USB flash drive.
Use
file.flush()
to flush this data. Data may be lost if the file is not closed or flushed before a
script ends.
If there is going to be a time delay before more data is written to a file, flush the file to prevent loss of
data because of an aborted test.
Also see
None