|
Contents | Previous | Next | Subchapters |
| See Also | h5read , read , write , and urlget |
Examples
rand.txt on the network
share \\Harmonic\temp, (You will need to edit the
value of shareFolder in the example to a value that
is a valid shared directory on your local network).
If at the O-Matrix command line prompt you enter
clear
const shareFolder = "\\Harmonic\temp\"
fileName = [shareFolder,"rand.txt"]
data = rand(10 , 15)
write(fileName, data)
close(fileName)
O-Matrix will create the file rand.txt in the \temp folder
on the machine Harmonic. Selecting My Network Places
in Windows explorer you can browse to this machine and directory
to verify that the file was created. If you continue the
example by entering
data = read(fileName,"double", 10, 15)
data(1,1)
O-Matrix will respond
0.253719
Data IO to a WebDAV Folder
clear
const webFolder = "\\www.msnusers.com\OMatrix\Documents\"
fileName = [webFolder,"README.TXT"]
Nr = nrows(fileName)
read(fileName, "char", Nr, 60)
close(fileName)
O-Matrix will respond
This folder is intended for storage of O-Matrix related
documents, utilities, and applications. Users interested
in participating in the O-Matrix news group should visit
http://groups.yahoo.com/group/omatrix/
(Note that the first operation on a WebDAV server may be slow but
subsequent operations generally run quickly)
You can also directly write to a WebDAV folder. If you
continue the example above by entering
fileName = [webFolder,"TEST.TXT"]
for i = 1 to 3 begin
write( fileName, seq(4)*i )
end
close
O-Matrix will create the file TEST.TXT on the server.
Using Internet Explorer you can browser to the server directory
to verify the contents of the file.