User manual
Section 13: Instrument Control Library (ICL) Series 3700 System Switch/Multimeter Reference Manual
13-182 3700S-901-01 Rev. C / July 2008
file:read()
Remarks
The format parameters may be any of the following:
"*n": Return a number.
"*a": Return the whole file, starting at the current position; return the empty string at
the end of the file.
"*l": Return the next line, skipping the end of line; return nil at the end of file.
n: Return a string with up to n characters; return an empty string if n is zero; return
nil at the end of file.
Any error encountered is logged to the error queue.
This command is not remotely accessible.
file:seek()
Function
Sets and gets a file's current position.
Usage
position = file:seek(whence, offset)
position: The new file position, measured in bytes from the beginning of the file.
file: The descriptor of the file.
whence: A string indicating the base against which offset is applied. The whence
attribute is optional; the default is "cur".
offset: The intended new position, measured in bytes from a base indicated by
whence. Optional, default is 0.
Remarks
The whence parameters may be any of the following:
"set": Beginning of file.
"cur": Current position.
"end": End of file.
If an error is encountered, it is logged to the error queue, and the command returns
nil and the error string.
This command is not remotely accessible.
file:write()
Function
Buffer data until a flush (file:flush() (on page 9-10) or io.flush()
(on page 9-12)) or close (file:close() (on page 9-10) or io.close() (on
page 9-12)) operation is performed.
NOTE Data may be lost if the file is not flushed or closed before the application
ends. A write function buffers the data until a flush or close operation is
requested.
Usage
file:write(data)
file: The descriptor of the file.
data: The data to write to the file. An arbitrary number of data values may be passed
to this command. All parameters must be either strings or numbers.