User manual

Series 3700 System Switch/Multimeter Reference Manual Section 9: Files
3700S-901-01 Rev. C / July 2008 9-7
print('error string is ' .. myfile2_err)
print('error number is ' .. myfile2_errnum)
end
else
print('myfile1 did not open for read')
print('error string is ' .. myfile1_err)
print('error number is ' .. myfile1_errnum)
end
endscript
After downloading the above script, type file_io_test() to execute the
script:
file_io_test()
The following output is returned after executing the file_io_test() script:
contents of myfile1 are:
Using io write to myfile1 to io output
11/27/07 07:57:23
file handle to write to myfile1
while myfile3 is output file for io
contents of myfile2 are:
file handle to write to myfile2
while myfile1 is output file for io
Using io write to myfile2 to io output
11/27/07 07:57:23
contents of myfile3 are:
file handle to write to myfile3
while myfile2 is output file for io
Using io write to myfile3 to io output
11/27/07 07:57:23
The following script will open a file called myfiletest three times. The first
time it is opened is for writing. Note that opening an existing file for writing
deletes any existing information in the file. The second time it is opened is for
appending more data to the existing data in the file. Opening a file for append
will not delete any existing data; it only adds data to the end of the existing file
contents. The third time the file is opened is for reading the entire contents of the
file (existing data and appended data).