User manual
Series 3700 System Switch/Multimeter Reference Manual Section 13: Instrument Control Library (ICL)
3700S-901-01 Rev. C / July 2008 13-181
file functions
Use the file commands when you need to manipulate file input or output with
Series 3700 instruments. These commands reside in the file descriptors and
operate exclusively on the file with which they are associated.
file:close()
Function
Closes a file after flushing any data that was written to it with io.write() (on page
9-14) or file:write() (on page 9-11).
Usage
file:close()
file: The descriptor of the file to close.
Remarks
This command is equivalent to io.close(file). It is not remotely accessible.
file:flush()
Function
Flush the buffered data for the specified file
Usage
file:flush()
file: The descriptor of the file to flush
Remarks
Use this command to flush data written to it by file:write() (on page 9-11) or
io.write() (on page 9-14). Using this function removes the need to close a file
after writing to it and allows it to be left open to write more data. Data may be lost if the
file is not closed or flushed before an application ends. To prevent the loss of data if
there is going to be a time delay before more data is written when you want to keep file
open and not close it, flush the file after writing to it.
file:read()
Function
Reads data from a file.
Usage
data = file:read(format)
data: The data read from the file. The number of return values matches the number of
values in format.
file: The descriptor of the file to read.
format: A string or number indicating the type of data to be read. Any number of
format parameters may be passed to this command, each corresponding to a returned
data value. The format attribute is optional; the default is "*l".