Section 11: TSP command reference Series 3700A System Switch/Multimeter Reference Manual
11-242 3700AS-901-01 Rev. D/June 2018
fileVar:close()
This function closes the file that is represented by the fileVar variable.
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.
Also see
File I/O (on page 9-27)
fileVar:flush() (on page 11-242)
fileVar:read() (on page 11-243)
fileVar:seek() (on page 11-244)
fileVar:write() (on page 11-245)
io.close() (on page 11-253)
io.open() (on page 11-255)
fileVar:flush()
This function writes buffered data to a file.
The file descriptor variable to flush
Details
The fileVar:write() or io.write() functions buffer data, which may not be written immediately
to the USB flash drive. Use fileVar:flush() to flush this data. Using this function removes the
need to close a file after writing to it, allowing the file to be left open to write more 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, and you want to keep the file
open, flush the file after you write to it to prevent loss of data.
Also see
File I/O (on page 9-27)
fileVar:write() (on page 11-245)
io.open() (on page 11-255)
io.write() (on page 11-257)